texworld / betterbib

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

Character escaping #243

Closed haji-ali closed 2 years ago

haji-ali commented 2 years ago

Thank you again for implementing the escaping of characters and using LaTeX commands instead of unicode. I have a large bibliography which betterbib processes almost perfectly.

However, I noticed the following problems:

@inproceedings{randompaper,
 author = {J\"oe D\'oe},
 editor = {de Groen, P. and Beauwens, R.},
 title = {An \^intesting title},
 booktitle = {{My book}},
 url={https://doi.org/10.1007/978-3-319-04537-5_3},
 doi={10.1007/978-3-319-04537-5_3},
}

which outputs

@inproceedings{randompaper,
 author = {D{\textbackslash}'oe, J{\textbackslash}''oe},
 editor = {de Groen, P. and Beauwens, R.},
 title = {An \^intesting title},
 booktitle = {\{My book\}},
 url = {https://doi.org/10.1007/978-3-319-04537-5\_3},
 doi = {10.1007/978-3-319-04537-5\_3},
}

Running betterbib again leads to more unnecessary escaping.

@inproceedings{randompaper,
 author = {D\{{\textbackslash}textbackslash\}'oe, J\{{\textbackslash}textbackslash\}''oe},
 editor = {de Groen, P. and Beauwens, R.},
 title = {An \^intesting--title},
 booktitle = {{\textbackslash}\{My book{\textbackslash}\}},
 url = {https://doi.org/10.1007/978-3-319-04537-5{\textbackslash}\_3},
 doi = {10.1007/978-3-319-04537-5{\textbackslash}\_3},
}
nschloe commented 2 years ago

Unfortunately, I have no time for this anymore right now.

nschloe commented 2 years ago

This is now fixed.