Package: zotero-bibtize
zotero-bibtizeRefurbish exported Zotero-BibTex bibliographies into a morefriendly representation.In the current state exporting the contents of a Zotero database to Bibtex
format most special characters are replaced by Zotero internal versions or
escaped before written to the output file. This behavior is exceptionally
annoying if entries contain code which is meant to be processed by(i.e. chemical or mathematical expressions and formulas in the title, etc.).zotero-bibtizecan be used to post-process the generated Zotero output files
and remove added escape sequences (i.e. the output is an identical replica
of the raw entry contents stored in the Zotero interface)UsageAfter installing the packagezotero-bibtizecan be invoked via a call to thezotero-bibtizecommand on the command line:$zotero-bibtizezotero_bibliography.bibbibtized_bibliography.bibwhich will process the original contentszotero_bibliography.biband writes
the processed contents to the newbibtized_bibliography.bibfile.
Note that specifying a target file is optional and the input file will be
overwritten if left out.ExampleOriginal bibtex entry generated by Zotero export:$catzotero_bibliography.bib@article{LangCM2015,title = {Lithium {Ion} {Conduction} in {\textbackslash}ce\{{LiTi}2({PO}4)3\} and {Related} {Compounds} {Based} on the \{{NASICON}\} {Structure}: {A} {First}-{Principles} {Study}},volume = {27},issn = {0897-4756, 1520-5002},shorttitle = {Lithium {Ion} {Conduction} in {\textbackslash}ce\{{LiTi}2({PO}4)3\} and {Related} {Compounds} {Based} on the {NASICON} {Structure}},url = {http://pubs.acs.org/doi/10.1021/acs.chemmater.5b01582},doi = {10.1021/acs.chemmater.5b01582},language = {en},number = {14},urldate = {2019-02-11},journal = {Chem. Mater.},author = {Lang, Britta and Ziebarth, Benedikt and Els{\textbackslash}"\{a\}sser, Christian},month = jul,year = {2015},pages = {5040--5048}}After runningzotero-bibtize zotero_bibliography.bib:$catzotero_bibliography.bib@article{LangCM2015,title = {Lithium Ion Conduction in \ce{LiTi2(PO4)3} and Related Compounds Based on the NASICON Structure: A First-Principles Study},volume = {27},issn = {0897-4756, 1520-5002},shorttitle = {Lithium Ion Conduction in \ce{LiTi2(PO4)3} and Related Compounds Based on the NASICON Structure},url = {http://pubs.acs.org/doi/10.1021/acs.chemmater.5b01582},doi = {10.1021/acs.chemmater.5b01582},language = {en},number = {14},urldate = {2019-02-11},journal = {Chem. Mater.},author = {Lang, Britta and Ziebarth, Benedikt and Els\"{a}sser, Christian},month = jul,year = {2015},pages = {5040--5048}}Custom BibTex Keys (very experimental)Custom BibTex keys can be defined through the optional--key-formatoption
that will be written to the bibliography file instead of the default keys
generated by Zotero. The key format defines the way how to combine and format
contents taken from the BibTex entry fields to build a custom key format. In
general the format key is of the form[field1:option][field2:option]...wherefielddefines the BibTex entry field to take the contents from and the
options defines different format options that will be applied to the contents.
Currently the following fields are implemented:authorAdds the author's lastnames to the key entryGeneral format:[author:num:options]numDefines the maximal number of author names used for the keyoptionsThe format options that will be applied to the author names, i.e.capitalize: Capitalize the namesupper: Transform names uppercaselower: Transform names to lowercaseabbreviate: Only us the first letter instead of the full nametitleAdds contents of the title string to the key entryGeneral format:[title:num:options]numDefines the maximal number of words in the title used for the key
(Note thatfunction keyswill not be taken into account)optionsThe format options that will be applied to the title contents, i.e.capitalize: Capitalize the namesupper: Transform names uppercaselower: Transform names to lowercaseabbreviate: Only us the first letter instead of the full namejournalAdds contents of the journal name to the key entryGeneral format:[journal:options]optionsThe format options that will be applied to the journal name, i.e.capitalize: Capitalize the namesupper: Transform names uppercaselower: Transform names to lowercaseabbreviate: Only us the first letter instead of the full nameyearAdd the publication year to the key entryGeneral format:[year:option]optionAdding the year only allows to specify two types of options:short: Add the year to the key as 2-digit quantitylong: Add the full year to the (i.e. as 4-digit quantitiy)ExampleIn the following example we create a custom key containing the first
author name and the abbreviated journal name followed by the publication
year. The key format defining such a key is of the following form:[author:1:capitalize][journal:capitalize:abbreviate][year]The original entry generated by Zotero looks like this:$catzotero_bibliography.bib@article{lang_lithium_ion_conduction_2015,title = {Lithium {Ion} {Conduction} in {\textbackslash}ce\{{LiTi}2({PO}4)3\} and {Related} {Compounds} {Based} on the \{{NASICON}\} {Structure}: {A} {First}-{Principles} {Study}},volume = {27},issn = {0897-4756, 1520-5002},shorttitle = {Lithium {Ion} {Conduction} in {\textbackslash}ce\{{LiTi}2({PO}4)3\} and {Related} {Compounds} {Based} on the {NASICON} {Structure}},url = {http://pubs.acs.org/doi/10.1021/acs.chemmater.5b01582},doi = {10.1021/acs.chemmater.5b01582},language = {en},number = {14},urldate = {2019-02-11},journal = {Chem. Mater.},author = {Lang, Britta and Ziebarth, Benedikt and Els{\textbackslash}"\{a\}sser, Christian},month = jul,year = {2015},pages = {5040--5048}}After runningzotero-bibtize zotero_bibliography.bib --key-format [author:1:capitalize][journal:capitalize:abbreviate][year]the original contents will be processed byzotero-bibtizeand the original
Zotero key will be replaced with the modified version:$catzotero_bibliography.bib@article{LangCM2015,title = {Lithium Ion Conduction in \ce{LiTi2(PO4)3} and Related Compounds Based on the NASICON Structure: A First-Principles Study},volume = {27},issn = {0897-4756, 1520-5002},shorttitle = {Lithium Ion Conduction in \ce{LiTi2(PO4)3} and Related Compounds Based on the NASICON Structure},url = {http://pubs.acs.org/doi/10.1021/acs.chemmater.5b01582},doi = {10.1021/acs.chemmater.5b01582},language = {en},number = {14},urldate = {2019-02-11},journal = {Chem. Mater.},author = {Lang, Britta and Ziebarth, Benedikt and Els\"{a}sser, Christian},month = jul,year = {2015},pages = {5040--5048}}