Skip to content
Pavel Petracek edited this page Mar 14, 2022 · 1 revision

papis

Papis is a command-line based document and bibliography manager. Below we list the set of custom feature updates. For rest of the documentation, please refer to the papis repository.

Automated database insertion

Shell script papis_add.sh automates the process of inserting a single .bib file to the papis database. The script handles .bib preprocessing (czech chars removal, double brackets removal, month field correction for Latex, double dash between numbers), renaming of the database entry to --ref parameter, document linking, and .yaml file postprocessing.

Example of adding a reference while linking a .pdf document

./papis_add.sh record.bib -r doe2022algebra -p ~/Downloads/doe_algebra.pdf

and with extra keywords and addendum

./papis_add.sh record.bib -r doe2022algebra -p ~/Downloads/doe_algebra.pdf -k "journal, algebra" -a "Q1 in Mathematics"

Notes

A feature integrating markdown notes into papis. Run ctrl+n on the selected document to open a .md file (stored under the directory of the respective database record).

Exporting

In our athame, papis export is remapped to

papis export -a -f bibtex > 'papis_export.bib' && bash ./ppb.sh

where ppb.sh is a custom shell script for vim-based processing of the output bib file, example:

#!/bin/bash

# get me vim, we will be using it alot to postprocess the generated json files
if [ -x "$(whereis nvim | awk '{print $2}')" ]; then
  VIM_BIN="$(whereis nvim | awk '{print $2}')"
  HEADLESS="--headless"
elif [ -x "$(whereis vim | awk '{print $2}')" ]; then
  VIM_BIN="$(whereis vim | awk '{print $2}')"
  HEADLESS=""
fi

INPUT_FILE=papis_export.bib
OUTPUT_FILE=main.bib

cp $INPUT_FILE $OUTPUT_FILE

# Line deletors
$VIM_BIN $HEADLESS -nEs -c '%g/type =/norm dd' -c "wqa" -- "$OUTPUT_FILE"
$VIM_BIN $HEADLESS -nEs -c '%g/doi =/norm dd' -c "wqa" -- "$OUTPUT_FILE"
Clone this wiki locally