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

bibtex doesn't handle escapes properly #266

Open
wilbowma opened this issue Aug 19, 2020 · 0 comments · May be fixed by #267
Open

bibtex doesn't handle escapes properly #266

wilbowma opened this issue Aug 19, 2020 · 0 comments · May be fixed by #267
Labels

Comments

@wilbowma
Copy link
Contributor

There are three kinds of mishandled escapes below:

  • bibtex escapes:
    • escaping # when it appears in a string \#. The \ gets rendered as a URL escape character, but should have been ignored.
    • escaping capital letters {CPS}. This escapes gets rendered as capital but eats the whitespace following it.
  • latex such as {\"u} and {$\Sigma$}.

I suppose handling the latex escapes is non-trivial, but the bibtex escapes should probably be handled properly. Could possibly handle the latex escapes by passing them on as literal, and assuming the backend knows how to handle them.

#lang scribble/base
@(require
  racket/dict
  racket/port
  scriblib/bibtex
  scriblib/autobib
  rackunit)

@(require/expose scriblib/bibtex (generate-bib))

@(define mybibs
  (call-with-input-string
     @string-append|{@Article{bowman2018:cps-sigma,
       author   = {Bowman, William J. and Cong, Youyou and Rioux, Nick and Ahmed, Amal},
       title    = {Type-preserving {CPS} Translation of {$\Sigma$} and {$\Pi$} Types Is Not Not Possible},
       url      = {https://www.williamjbowman.com/papers\#cps-sigma},
       journal  = {PACMPL},
       year = 2018,
     }

     @Article{flueckiger2018:jit,
       author    = {Fl{\"u}ckiger, Olivier and Scherer, Gabriel and Yee, Ming-Ho and Goel, Aviral and Ahmed, Amal and Vitek, Jan},
       title     = {Correctness of speculative optimizations with dynamic deoptimization},
       year = 2018,
       journal  = {PACMPL},
       }}| bibtex-parse))

@(define-cite a~cite acitet generate-bibliography)

@(define (~cite str)
  (a~cite (generate-bib mybibs str)))

@~cite{bowman2018:cps-sigma}
@~cite{flueckiger2018:jit}

@(generate-bibliography)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants