texworld / betterbib

:green_book: Command-line tools for bibliographies.
818 stars 42 forks source link

Unintended conversion from LaTex to typesetted symbol #257

Closed mayrmt closed 10 months ago

mayrmt commented 2 years ago

Description

Here's a minimal example of my problem with betterbib format. The file my.bib, that I want to format, looks like this:

@article{Test2022a,
  Author = {Body, Some}, 
  Journal = {Newspaper},
  Number = {5}, 
  Pages = {7--9},
  Title = {Title with a greek symbol: $\alpha$},
  Volume = {5},
  Year = {2022}}

Running the command betterbib format my.bib produces the following output:

@article{Test2022a,
 author = {Body, Some},
 journal = {Newspaper},
 number = {5},
 pages = {7–9},
 title = {Title with a greek symbol: α},
 volume = {5},
 year = {2022},
}

I'd like to not convert $\alpha$ to the typesetted version "α". In fact, I'd like to retain the original `$\alpha$ for later processing in LaTeX.

Context

  1. File my.bib is fully local. I don't pull anything from any web database.
  2. Here's the version info delivered via pip show betterbib:
    Name: betterbib
    Version: 4.3.8
    Summary: Better BibTeX data
    Home-page: 
    Author: 
    Author-email: Nico Schlömer <nico.schloemer@gmail.com>
    License: 
    Location: /usr/local/lib/python3.9/site-packages
    Requires: appdirs, kgt, pybtex, pylatexenc, requests, requests-cache, rich, tomli, unidecode, x21
    Required-by: 
mayrmt commented 2 years ago

Here's a similar conversion from Latex commands to typesetter symbols:

Bibtex entry:

@article{Bechet2009a,
  author = {B\'echet, \'Eric and Mo\"es, Nicolas and Wohlmuth, Barbara I.},
  journal = {International Journal for Numerical Methods in Engineering},
  number = {8},
  pages = {931--954},
  title = {A stable Lagrange multiplier space for stiff interface conditions within the extended finite element method},
  volume = {78},
  year = {2009}}

Output of betterbib format my.bib:

@article{Bechet2009a,
 author = {Béchet, Éric and Moës, Nicolas and Wohlmuth, Barbara I.}, 
 journal = {International Journal for Numerical Methods in Engineering},
 number = {8}, 
 pages = {931--954},
 title = {A stable Lagrange multiplier space for stiff interface conditions within the extended finite element method},
 volume = {78},
 year = {2009},
}

It looks like betterbib is doing the Latex typesetting. Maybe add an option to suppress it?

mayrmt commented 1 year ago

@nschloe Is there anything that I can do to assist in fixing this?

mayrmt commented 1 year ago

There also seems to be the problem, that curly braces (used to protect capitalization within paper titles for example) are removed during the betterbib formatting. This leads to unintended de-capitalization in the betterbib output.

nschloe commented 10 months ago

This is fixed in betterbib 7.