2 # bibtex_to_paper opens the paper corresponding to a bibtex key
3 # and is released under the terms of the GNU GPL version 3, or any
4 # later version, at your option. See the file README and COPYING for
6 # Copyright 2014 by Don Armstrong <don@donarmstrong.com>.
20 bibtex_to_paper - opens the paper corresponding to a bibtex key
24 bibtex_to_paper [options] bibtexkey
27 --bibtex, -b bibtex file to look up key in
28 --bibtex-cache, -c bibtex cache file
29 --build-cache, -B build cache using bibtex files
30 --pdf-dir pdf directory
31 --pdfviewer, -p pdf viewer to use
32 --debug, -d debugging level (Default 0)
33 --help, -h display this help
34 --man, -m display manual
42 Bibtex file to look key up in
44 =item B<--bibtex-cache, -c>
46 Bibtex cache file; rebuilt if bibtex file changes
48 =item B<--pdfviewer, -p>
50 PDF viewer to use; defaults to evince unless a .xoj exists, in which
55 Debug verbosity. (Default 0)
59 Display brief usage information.
76 my %options = (debug => 0,
82 'build_cache|build-cache|B!',
84 'bibtex_cache|bibtex-cache|c=s',
86 'debug|d+','help|h|?','man|m');
88 pod2usage() if $options{help};
89 pod2usage({verbose=>2}) if $options{man};
91 $DEBUG = $options{debug};
94 if (not exists $options{bibtex} and
95 not exists $options{bibtex_cache}) {
97 "You must give at least one of --bibtex".
101 pod2usage(join("\n",@USAGE_ERRORS)) if @USAGE_ERRORS;
103 sub parse_bibtex_file {
108 sub initialize_database {