2020-08-20 07:11:07 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#This is just an example of an external script for finding corresponding file to the citation of the form Author + Year.
|
|
|
|
#You will need to accomodate it to your particular situation.
|
|
|
|
#
|
2020-08-21 07:25:10 +00:00
|
|
|
#Syntax: paperview Year Author
|
2020-08-20 07:11:07 +00:00
|
|
|
#Output: absolute path to the file(s)
|
|
|
|
#
|
2020-08-21 01:51:06 +00:00
|
|
|
#Dependencies:
|
2020-08-20 07:11:07 +00:00
|
|
|
#1) mlocate/updatedb or similar package installed and running.
|
|
|
|
#2) stored papers must contain first author name and year of publication in filename.
|
|
|
|
|
|
|
|
VIEWER=qpdfview
|
|
|
|
MAX_RESULTS=2
|
|
|
|
|
|
|
|
name="$2"
|
|
|
|
year="$1"
|
|
|
|
|
|
|
|
if [ -z "$name" ]; then exit; fi
|
|
|
|
|
|
|
|
FILE=`locate -i "$name" | grep -Ei '\.pdf$|\.ps$' | grep "$year" | head -n $MAX_RESULTS`
|
|
|
|
|
|
|
|
|
|
|
|
#Putting in background necessary so that LyX does not wait for viewer to end
|
|
|
|
$VIEWER ${FILE} &
|
|
|
|
|