A BibTeX-centric bibliography manager written in POSIX shell
The prerequisites for
xclip/xsel/pbcopy (Mac OS)
$BIBis the path to your BibTeX file, and
$BIB_PDF_PATHis the path to your pdf directory. You can add these three variables by modifying the paths and running the following pseudo code in terminal:
printf '%s\n' "export BIB='path/to/your/BibTeX/file'" >> $HOME/.profile printf '%s\n' "export BIB_PDF_PATH='path/to/your/pdf/directory'" >> $HOME/.profile printf '%s\n' "export BIB_UNI_KEY='Key to access your journals by your university'" >> $HOME/.profile # Not required
shbib, you just need open your terminal, type
git clone https://github.com/huijunchen9260/shbib to download this project,
cd to the directory with
shbib script, and run
shbib by typing
? to understnad the keybinding corresponding to each action:
k/↑ - up j/↓ - down l/→ - right h/← - left Ctrl-f/PageDown - PageDown Ctrl-u/PageUp - PageUp g/Home - go to top G/End - go to bottom s - search online by text p - search online by metadata in PDF file w - search google scholar by text c - copy BibTeX entry from your $BIB o - open PDF file by BibTeX entry i - insert new BibTeX entry e - edit existing BibTeX entry b - manually build database by rename and encode metadata into PDF file B - automatically build database by rename and encode metadata into PDF file R - create new BibTeX entry sublibrary store at: $BIB_PDF_PATH/Libs r - open existing BibTeX entry sublibrary store at: $BIB_PDF_PATH/Libs n - write notes for BibTeX entry store at: $BIB_PDF_PATH/Notes / - search the current page default: case-insensitive search contain uppercase: case-sensitive search ? - show keybinds
Nice! You are all set!
Writing in POSIX shell is an adventure. What you need to do is to force yourself to NOT use external program , to NOT create sub-shell by command substitution
$(), and furthermore, to NOT utilize regular expression but pathname globbing instead. I find a lot of useful technique that can basically replace the usage of
awk, and most external program while developing this project. Those technique are:
set -- $varto create the only "array" in POSIX shell, and use
for line do ... doneto manipulate each item in this array.
$IFS) to decide how
set -- $varwould separate the array. E.g., we can create newline character
set -- $varto separate each line as an element in array.
casestatement globbing matching -> replace
awkregular expression matching
ref_searchfunction and shell special parameters
$tab, by create a "hard" character:
nl=' ' tab=' '
json_pretty_printfunction for detail information.