filltex
filltex: Automatic queries to ADS and INSPIRE databases to fill LaTex bibliography - Published in JOSS (2017)
Science Score: 95.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 5 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org, zenodo.org -
✓Committers with academic emails
2 of 5 committers (40.0%) from academic institutions -
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Repository
Automatic queries to ADS and INSPIRE databases to fill LaTex bibliography
Basic Info
Statistics
- Stars: 21
- Watchers: 5
- Forks: 6
- Open Issues: 6
- Releases: 6
Metadata Files
README.md
filltex
Automatic queries to ADS and INSPIRE databases to fill LaTex bibliography
filltex is a simple tool to fill LaTex reference lists with records from the ADS and INSPIRE databases. ADS and INSPIRE are the most common databases used among the astronomy and theoretical physics scientific communities, respectively. filltex automatically looks for all citation labels present in a tex document and, by means of web-scraping, downloads all the required citation records from either of the two databases. filltex significantly speeds up the LaTex scientific writing workflow, as all required actions (compile the tex file, fill the bibliography, compile the bibliography, compile the tex file again) are automated in a single command. We also provide an integration of filltex for the macos LaTex editor TexShop.
If you use filltex for your research, please drop a citation to this paper:
- filltex: Automatic queries to ADS and INSPIRE databases to fill LaTex bibliography, Davide Gerosa, Michele Vallisneri, The Journal of Open Source Software 2 (2017) 13.
Of course, you can use filltex to cite filltex! Just put \cite{2017JOSS....2..222G} in your tex file!
Installation
filltex can be installed from the python package index Pypi:
pip install filltex
If you're a TexShop user and want to use this feature, run
filltex install-texshop
If you want to give it a try, you can run it on the example.tex file provided in this repository:
git clone https://github.com/dgerosa/filltex.git
cd filltex/example
filltex example
and you should get a filled .bib file and a finished .pdf.
What's about?
What happens when you compile a LaTex file? How's bibliography handled?
- Run
pdflatexand all requested citation keys are dumped into a.auxfile. - You should have the required entries in you
.bibfile. - Run
bibtex, which looks for citations inside the.bibfile and writes the results into a.bbl. - Run
pdflatexagain, which processes the.bblinto the compiled paper, and dumps the citation records into.aux. - Finally run
pdflatexagain, which puts the correct citation records into the paper.
The commands you need to run are: pdflatex, bibtex, pdflatex, pdflatex. These, of course can be put into a script or a makefile and done in one goal.
filltex is meant to automatically solve the second point as well: look for citations on ADS, INSPIRE or both.
So, here is the deal:
- The
fillbibpython script queries both databases and creates/updates a.bibfile without getting each record manually. - The
filltexbash script puts everything together to go from a.tex(and no.bib) into a.pdf. - I also provide TexShop engines for mac users
Of course, all of this works if your citations are specified in the ADS or INSPIRE format, e.g. \cite{2016PhRvL.116f1102A}, \cite{Abbott:2016blz}. If you use your personal keys \cite{amazing_paper}there's no way to get them from a database.
Usage
fillbib (script)
fillbib has two working modes. It can either look for citations into a .aux file and create/update a bibtex file with the records found on ADS and INSPIRE, or it can fetch a list of bibtex entries specified from the command line from ADS or INSPIRE.
The first argument specifies the subcommand to run.
texwill produce a bibtex file given an.auxfilelistwill print a bibtex file given a list of keys from CLI
The help for the two subcommands can be obtained with
fillbib.py {tex,list} --help
When working in tex mode it is possible to specify the name of the bibtex file using the option --bibtex. Otherwise, the code will scan the .aux file to guess the name of your bibliography file. Arguments can be typed with or without extension, and the script is smart enough to figure it out. You need to have .aux file already, not just the .tex. If you don't have it, run pdflatex once.
fillbib.py contains two short unit tests, to make sure the web-scarping part is done correctly. You can run them from the filltex directiory using
python
> import fillbib
> fillbib.test_ads()
> fillbib.test_inspire()
or simply using pytest
pytest fillbib
fillbib supports both python 2 (2.6 or higher) and python 3.
filltex (script)
filltex does the whole thing: compiles LaTex, fills the bibliography and gives you the final .pdf. Usage:
filltex <tex file>
Argument can be with or without extension, and the script is smart enough to figure it out.
The script will replace some journal name with their ISO4 abbreviations. You can disable this with the journals flag. Please send me pull requests with new journals that should be added here! ADS bibliography items contain some journal macros, which are also replaced in favour of ISO4. If you disable the ISO4 conversion, you'll need to use aas_macros.sty.
By default, the script will also change your .tex file if an ADS arXiv entry has been published (see below). You can disable this by turning off updatepublished, see the help page.
At the end, filltex also runs TexCount which counts the words in your document.
TexShop
I use the TexShop editor, so I wrote an implementation of filltex for it. If you copied the filltex.engine file as specified above, just open your paper with TexShop and select filltex from the drop menu on the left. Now automagically compile your paper with Typeset or cmd-T.
<!-- The TexShop engine will work only if the path is updated in your .bashrc, see above. -->
Example
A short example.tex file is provided, where you can try this new way of writing papers!
Known limitations
Treating arXiv e-prints with ADS is tricky. When an e-print gets published they change the database key, but make the old key point to the new version! For instance, the key switches from
2016arXiv160203837Tto2016PhRvL.116f1102A. If you're citing an e-print which is not yet published, everything is fine: only the arXiv key (e.g.2016arXiv160203837T) is available and your reference list will show the arXiv version. If you're citing a paper that is published, both the e-print key (e.g.2016arXiv160203837T) and the published-version key (e.g.2016PhRvL.116f1102A) are available. When used, they will both point to the same published version! If you write a document with citations to both, this will cause the same record to appear twice in your reference list (see the example file). To avoid the issue,filltextries to update the pre-print key in your tex file if it finds a new version. In general, always use the published-paper key if a published version is out. INSPIRE doesn't have this problem, because they don't change the citation key when a paper gets published.Multiple bibliographies are not allowed, only one
.bibfile per paper. I don't plan to implement multiple bibliographies in here, because you're not going to need them with this script: one paper, one bibliography, that's all.
Manual installation from repository
If you don't like pip (but why wouldn't you?), you can install the code manually:
git clone https://github.com/dgerosa/filltex.git # Clone repo
cd filltex
chmod +x bin/* # Make bin content executable
PATH=$PATH:$(pwd)/bin # Add bin directory to path
echo "PATH=$PATH:$(pwd)/bin" >> ${HOME}/.bashrc # To add the new path to your .bashrc
cp filltex.engine ~/Library/TeXshop/Engines/filltex.engine # To install the Texshop engine
filltex uses TexCount, which is included in most Tex distribution. In case it's not in yours, here you can find installation instruction.
References to filltex
filltexis included in the suggested tools from the INSPIRE team.filltexis included the official v3.80 release of Texshop.
Credits
The code is developed and maintained by Davide Gerosa. If you find bugs, want to contribute to this project (any help is welcome!) or need help with it, just open an issue here on GitHub.
The idea started from this python course taught by Michele Vallisneri at Caltech (and in particular from this example) and was later developed with key contributions from David Radice. We also thank Lars Holm Nielsen, reviewer for The Journal of Open Software, for several suggestions which improved filltex. TexCount is developed by Einar Andreas Rodland. Useful info on the INSPIRE and ADS APIs are available here and here.
Changes
v1.0: Initial release, main functionalities.
v1.1: Version accepted in JOSS.
v1.2: Uploaded on pip.
v1.3: Compatible with new ADS "Bumblebee".
v1.4: Compatible with new INSPIRE API.
v1.5: New tex and list subcommands.
v1.7: New treatment of journal names, converting to ISO4 when available.
Owner
- Name: Davide Gerosa
- Login: dgerosa
- Kind: user
- Location: Milan, Italy
- Company: University of Milano-Bicocca
- Website: http://www.davidegerosa.com
- Repositories: 31
- Profile: https://github.com/dgerosa
University professor - researcher in relativistic astrophysics, gravitational waves, and black holes.
JOSS Publication
GitHub Events
Total
- Delete event: 1
- Issue comment event: 1
- Push event: 5
- Pull request event: 2
Last Year
- Delete event: 1
- Issue comment event: 1
- Push event: 5
- Pull request event: 2
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Davide Gerosa | d****a@c****u | 136 |
| David Radice | d****6@p****u | 8 |
| Michele Vallisneri | v****s@v****g | 1 |
| Micha Moskovic | m****s@g****m | 1 |
| Arfon Smith | a****n | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 13
- Total pull requests: 11
- Average time to close issues: about 2 months
- Average time to close pull requests: 2 days
- Total issue authors: 6
- Total pull request authors: 5
- Average comments per issue: 1.15
- Average comments per pull request: 0.45
- Merged pull requests: 9
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- lnielsen (8)
- dgerosa (1)
- duetosymmetry (1)
- michamos (1)
- nmiekley (1)
- geoffrey4444 (1)
Pull Request Authors
- dradice (7)
- dgerosa (1)
- arfon (1)
- michamos (1)
- restrepo (1)
- vallis (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 119 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 10
- Total maintainers: 1
pypi.org: filltex
Automatic queries to ADS and InSPIRE databases to fill LATEX bibliography
- Homepage: https://github.com/dgerosa/filltex
- Documentation: https://filltex.readthedocs.io/
- License: MIT
-
Latest release: 1.7.0
published 6 months ago
