Package: academic-ads-bibtex
academic-ads-bibtexAPI documentation is available at:ReadTheDocsOverviewInstallationFrom PyPiFrom sourceExamplesVersioningAuthorsLicenseOverviewTheHugo Academic admin toolallows for the ingestion of BibTeX records to add to the publication list.
One easy solution is to use the NASA ADS to retrieve such records from a
NASA ADS Library. However, such records often contain LaTeX\newcommand.
For example:@ARTICLE{2016ApJS..226....5L,
   author = {{Ly}, C. and {Malhotra}, S. and {Malkan}, M.~A. and {Rigby}, J.~R. and 
        {Kashikawa}, N. and {de los Reyes}, M.~A. and {Rhoads}, J.~E.
        },
    title = "{The Metal Abundances across Cosmic Time (MACT) Survey. I. Optical Spectroscopy in the Subaru Deep Field}",
  journal = {\apjs},
archivePrefix = "arXiv",
   eprint = {1602.01089},
 keywords = {galaxies: abundances, galaxies: distances and redshifts, galaxies: evolution, galaxies: ISM, galaxies: photometry, galaxies: star formation},
     year = 2016,
    month = sep,
   volume = 226,
      eid = {5},
    pages = {5},
      doi = {10.3847/0067-0049/226/1/5},
   adsurl = {https://ui.adsabs.harvard.edu/abs/2016ApJS..226....5L},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}Here, the journal name is simplified to "\apjs". This ends up propagating into
Hugo Academic sites. To fix this, this simple pure Python script will convert
such aliases into the full journal names. It uses a journal database to
conduct the replacement.InstallationThere are two ways to get the code:FromPyPiFromsourceBut first, we recommend creating a separate (virtual) environment to avoid any
possible conflicts with existing software that you used. Instructions are
provided forcondaandvirtualenv.From PyPi:Usingconda:(base)$(sudo)condacreate-nbibtexpython=3.7(base)$condaactivatebibtex(bibtex)$(sudo)pipinstallacademic-ads-bibtexUsingvirtualenv:(base)$(sudo)condainstallvirtualenv# if not installed(base)$mkdiracademic-ads-bibtex(base)$cdacademic-ads-bibtex(base)$virtualenvvenv(base)$sourcevenv/bin/activate(venv)$pipinstallacademic-ads-bibtexFrom source:Usingconda:(base)$(sudo)condacreate-nbibtexpython=3.7(base)$condaactivatebibtex(bibtex)$gitclonehttps://github.com/astrochun/academic-ads-bibtex.git(bibtex)$cdacademic-ads-bibtex(bibtex)$(sudo)pythonsetup.pyinstallUsingvirtualenv:(base)$(sudo)condainstallvirtualenv# if not installed(base)$gitclonehttps://github.com/astrochun/academic-ads-bibtex.git(base)$cdacademic-ads-bibtex(base)$virtualenvvenv(base)$sourcevenv/bin/activate(venv)$pythonsetup.pyinstallExamplesThe primary script to execute isacademic_ads_bibtex.
The above installation will include this executable in your python
environment paths.Execution requires only one argument, which is the full path to the BibTeX
file. It can be provided with the-for--filenamecommand-line flags.$ academic_ads_bibtex -f /full/path/to/my_pubs.bblBy default:The code uses the repository-based journal database,bibtex_journals.db.
This can be changed by specifying the-dor--db_filenamecommand-line
flag.The revised BibTeX file will be based on the inputfilenamewith the
prefix changed to include_revised. For example, for the above case,
the output file will be/full/path/to/my_pubs_revised.bbl. This can be
changed by specifying the-oor--out_filenamecommand-line flag.A log file is constructed:/full/path/to/academic_ads_bibtex.YYYY-MM-DD.logVersioningWe useSemVerfor versioning. For the versions available,
see thereleases on this repository.AuthorsChun Ly, Ph.D. (@astrochun)LicenseThis project is licensed under theGNU GPLv3 License.
See theLICENSEfile for details.