Closed ashwinvis closed 5 years ago
This is right. You can easily add formatters for other BibTeX types by adding extra clauses to the file format.go
. You can see examples there and it’s fairly self explanatory how to do this. PRs welcome if you add formatters that would be useful for others.
NB. you may have to also modify the rsc
string to ensure that whatever fields you are looking for are preserved when your file is parsed:
No Go experience here, but I see what you mean. Why wasn't the text formatted by the "default" case?
https://github.com/msprev/fzf-bibtex/blob/master/format/format.go#L84-L98
Good point. It may be that bibtool ignores these as they are not standard BibTeX types. You can check if this has happened by running:
bibtool ref.bib -o parsed.bib
and check if they have been skipped in parsed.bib. If so, it is possible to change this behaviour by changing the rsc string to make sure bibtool doesn't ignore them (bibtool docs, pp. 24--25).
OK, so this is not strictly a bibtex file, but uses biblatex. Bibtool can also parse it, but not by default (see bibtool docs pp. 14). Also I don't think the rsc string has to be changed, as author, date, title fields are already present.
/tmp ❯❯❯ bibtool -r biblatex ref.bib
@Article{ smith_finite-size_1994,
Author = {Smith, Leslie M. and Yakhot, Victor},
Date = {1994-09},
DOI = {10.1017/S0022112094002065},
ISSN = {1469-7645, 0022-1120},
JournalTitle = {J. Fluid Mech.},
langid = {english},
Pages = {115-138},
Title = {Finite-Size Effects in Forced Two-Dimensional Turbulence},
Volume = {274}
}
@Online{ smith_notes_2018,
Author = {Smith, Nathaniel J.},
Date = {2018},
Title = {Notes on Structured Concurrency, or: {{Go}} Statement
Considered Harmful \textemdash{} Njs Blog},
URL = {https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/}
}
@Software{ smith_trio_2017,
Author = {Smith, Nathaniel J.},
Date = {2017},
Title = {Trio: A Friendly {{Python}} Library for Async Concurrency
and {{I}}/{{O}}},
URL = {https://trio.readthedocs.io/en/latest/index.html}
}
/tmp ❯❯❯ bibtool -r biblatex thesis.bib
/tmp ❯❯❯ bibtool ref.bib
@online{smith_notes_2018,
_^
*** BibTool ERROR: (line 13 in ./ref.bib): Unknown entry type
*** BibTool WARNING: Skipping to next '@'
*** BibTool WARNING: (line 20 in ./ref.bib): 254 non-space characters ignored.
@software{smith_trio_2017,
_^
*** BibTool ERROR: (line 20 in ./ref.bib): Unknown entry type
*** BibTool WARNING: Skipping to next '@'
@Article{ smith_finite-size_1994,
author = {Smith, Leslie M. and Yakhot, Victor},
date = {1994-09},
doi = {10.1017/S0022112094002065},
issn = {1469-7645, 0022-1120},
journaltitle = {J. Fluid Mech.},
langid = {english},
pages = {115-138},
title = {Finite-Size Effects in Forced Two-Dimensional Turbulence},
volume = {274}
}```
You need to add a new type to the rsc string as described in the docs, page numbers I posted previously, for bibtool to parse it.