bibtex parse-pages may be a little too restrictive
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 250
- Forks
- 102
- Avg merge
- 11d 11h
- Merged PRs (30d)
- 1
Description
The regex matching in parse-pages restricts BibTeX pages field to two numbers separated by one or more hyphens. However, I occasionally encounter journals that use a single number or identifier in the pages field, or those that use letters in the page numbers, or those that use an en-dash instead of two hyphens as the separator. These edge cases would all cause Scribble to fail.
(define (parse-pages ps)
(match ps
[(regexp #rx"^([0-9]+)\\-+([0-9]+)$" (list _ f l))
(list f l)]
[#f
#f]
[_
(error 'parse-pages "Invalid page format ~e" ps)]))
I'm not sure if it would be in the best interest of the developers to spend time fixing these edge cases. Would it be possible to have an option to override parse-pages (or make it a warning instead of an error)?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at parse-pages in scribble-lib/scriblib/bibtex.rkt around line 439 and inspect how its result is used for BibTeX pages fields. Compare the current behavior with the single-number, lettered, and en-dash cases described; done means the handling policy is defined and those cases no longer cause the reported failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- tex
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100