Skip Menu |

This queue is for tickets about the Text-BibTeX CPAN distribution.

Report information
The Basics
Id: 98806
Status: open
Priority: 0/
Queue: Text-BibTeX

People
Owner: Nobody in particular
Requestors: DUFFEE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: problem parsing bare month field
Exporting BibTeX format from Zotero doesn't protect the month field (I don't know why) and produces 'warning: undefined macro "aug"' when I parse the entry and 'field "month" has undefined value' when I try to write the entry to a new file. Don't know if you consider it a bug in Zotero or a test case you hadn't considered. Here's the entry it choked on. @article{wu_modeling_2009, title = {Modeling scientific-citation patterns and other triangle-rich acyclic networks}, url = {http://arxiv.org/abs/0908.2615}, doi = {doi:10.1103/PhysRevE.80.037101}, abstract = {We propose a model of the evolution of networks}, journal = {0908.2615}, author = {Wu, Zhi-Xi and Holme, Petter}, month = aug, year = {2009}, note = {Phys.Rev.E 80, 037101 (2009).}, keywords = {Computer Science - Digital Libraries, Physics - Physics and Society} }
On Thu Sep 11 14:29:59 2014, DUFFEE wrote: Show quoted text
> Exporting BibTeX format from Zotero doesn't protect the month field (I > don't know why) and produces 'warning: undefined macro "aug"' when I > parse the entry and 'field "month" has undefined value' when I try to > write the entry to a new file. > > Don't know if you consider it a bug in Zotero or a test case you > hadn't considered. Here's the entry it choked on. > > @article{wu_modeling_2009, > title = {Modeling scientific-citation patterns and other triangle- > rich acyclic networks}, > url = {http://arxiv.org/abs/0908.2615}, > doi = {doi:10.1103/PhysRevE.80.037101}, > abstract = {We propose a model of the evolution of networks}, > journal = {0908.2615}, > author = {Wu, Zhi-Xi and Holme, Petter}, > month = aug, > year = {2009}, > note = {Phys.Rev.E 80, 037101 (2009).}, > keywords = {Computer Science - Digital Libraries, Physics - > Physics and Society} > }
Hello, Thanks for pointing this up. In fact, accordingly with the spec (http://www.bibtex.org/Format/) non quoted strings are references to prior defined strings. Making me more clear, if in the beginning of the document you have: @string { aug = "August" } then the bibtex would be correct, and should be parsed correctly. I would prefer if you could poke zotero devs, and see if they can include the quotes, or define the macros they use. Nevertheless, if you do not get any answers from them, let us know, so we can see if there is an easy way to fix that for you. Best, Alberto
Hello again. Rereading the spec I noticed that month = aug, is never valid. predefined strings only can be used if they are concatenated with other strings: month = aug # "something", An the spec also says that values are enclosed in braces or quotes. Given that the use you mention is not considered at all by the spec, we might just allow it. Comments, Philip? Thanks ambs
bibtex.org is not the spec. It's someone's web site that collected some information, just like I did in 1996 (but hosted on a university server that removed it after 10 years). Leslie Lamport, "LaTeX", 2nd edition, Appendix B, page 159: "Some abbreviations are predefined by the bibliography style. These always include the usual three-letter abbreviations for the month: jan, feb, mar, etc." Page 163: "month: The month in which the work was published or, for an unpublished work, in which it was written. Use the standard three-letter abbreviations decribed above." You should always use the bare three-letter abbreviation. Why? So when you change to a style for a French journal it will use the French month names. For English journals it will know how to properly format the date for the journal's requirements (Aug, August, 08/year, etc). It also helps prevent misspellings and helps translators.
On Thu Sep 11 16:38:12 2014, DANAJ wrote: Show quoted text
> bibtex.org is not the spec. It's someone's web site that collected > some information, just like I did in 1996 (but hosted on a university > server that removed it after 10 years). > > Leslie Lamport, "LaTeX", 2nd edition, Appendix B, page 159: > > "Some abbreviations are predefined by the bibliography style. These > always include the usual three-letter abbreviations for the month: > jan, feb, mar, etc." > > Page 163:
Ok, good catch. Thanks. Do not have the book at home :-) Will work on it. Cheers
By the way, here is a link to the site I had back then: https://web.archive.org/web/20020605035122/http://www.ecst.csuchico.edu/~jacobsd/bib/formats/index.html Sadly CPAN didn't exist when I worked on my module, and right about the time it started I got a job and stopped doing Perl for a while. Someday I should move my library to a proper module, but then I'd want to clean it up from its Perl 4 and pre-Unicode state, which would take quite a bit of time. It still works (albeit now with a defined(%hash) warning) and has some advantages over the other modules, but it's *old*.
Wow ... So on Dana's information, I won't file a bug with Zotero and let Alberto work on it. It's not a problem for me any more. My work around was to pre-process the file with perl -i -pe 's/month = (\w+),/month = \{$1\},/' file.bib With that in place, the module works very well as I try to convert accented characters to LaTeX acceptable forms. $author =~ s/ñ/\\~\{n\}/g Many thanks, Boyd On Thu Sep 11 16:38:12 2014, DANAJ wrote: Show quoted text
> Leslie Lamport, "LaTeX", 2nd edition, Appendix B, page 159: > > "Some abbreviations are predefined by the bibliography style. These > always include the usual three-letter abbreviations for the month: > jan, feb, mar, etc."