How can parse .bst in order to resgister a pybyex.style.formatting plugin?
I looked in the repository found the function parse_file from pybtex.bibtex.bst.
I think I should do something like what follows but can t seem to create a template from the output of the parse_file function.
from pybtex.style.formatting.unsrt import Style as UnsrtStyle
from pybtex.style.template import toplevel # ... and anything else needed
from pybtex.plugin import register_plugin
class MyStyleFromBst(UnsrtStyle):
def format_XXX(self, e):
template = toplevel [
# Do something with the bst file
]
return template.format_data(e)
register_plugin('pybtex.style.formatting', 'mystyleFomBst', MyStyleFromBst)
The snippet is originally from sphinxcontrib-bibtex documentation.
https://sphinxcontrib-bibtex.readthedocs.org/en/latest/usage.html
Well, you you can't register .bst files as formatting plugins. The reason is that .bst styles are hard-coded to output LaTeX markup and do not other formats. Pybtex formatting plugins have to be written in Python.
I see. I have no other choice than registering the style manually then.
Well thanks for taking the time to answer.
Last edit: Ishmael Belghazi 2015-03-02
I see. I have no other choice than registering the style manually then. Well thanks for taking the time to answer.