LibreCat / Catmandu-BibTeX

Catmandu modules for working with bibtex data
https://metacpan.org/pod/Catmandu::BibTeX
Other
2 stars 0 forks source link

add encoding option #3

Closed vpeil closed 9 years ago

vpeil commented 10 years ago

There are two possible ways to do that:

  1. Add a Fix package to this distribution: Catmadu::Fix::latex_encode/decode. Priovide fields parameter to express which fields to encode/decode.
  2. Provide encode flag to the importer/exporter:
my $imp = Catmandu::Importer::BibTeX->new(file => "articles.bib", encode => 1);

The first solution is more flexible as we can implement different fixes. What do you think?

pietsch commented 10 years ago

Pardon me – to do what? I am missing some context here.

vpeil commented 10 years ago

look here, people produce bibtex like this:

conference {test,
    title = {Sensorische und langzeitged{\"a}chtnisbasierte Aufmerksamkeitssteuerung: Augenbewegungen w{\"a}hrend sensomotorischen Lernens},
    booktitle = {Proc. 48. Kongress der Deutschen Gesellschaft f{\"u}r Psychologie DGPs2012},
    year = {Submitted},
    author = {Foerster, Rebecca and Elena Carbone and Hendrik Koesling and Schneider, Werner X.}
}
$ catmandu convert BibTeX to YAML < {above_file}

print this:

_citekey: test
author: Foerster, Rebecca and Elena Carbone and Hendrik Koesling and Schneider, Werner
  X.
booktitle: Proc. 48. Kongress der Deutschen Gesellschaft f{\"u}r Psychologie DGPs2012
title: 'Sensorische und langzeitged{\"a}chtnisbasierte Aufmerksamkeitssteuerung: Augenbewegungen
  w{\"a}hrend sensomotorischen Lernens'
type: conference
year: Submitted

I just want the awesome german "ü" and "ä", in a generic way through catmandu. And there's a bunch of tex stuff to be transformed, like textquotes in title or apostrophes, etc. We do not like to have these in our databases, right?

This one is marked as "question". Do other people find this stuff interesting?

pietsch commented 10 years ago

Yes, I want this functionality. To do it properly (covering more that just umlauts), I guess we will have to add a TeX parser as another dependency.

vpeil commented 10 years ago

We should checkout a new branch and test some modules for this task. Maybe we write a test before?

Here are some modules to consider:

Is this task too complex? Do we even need a latex compiler?

vpeil commented 9 years ago

won't fix.