[LyX/master] Example script for looking up the citation pdfs.

Pavel Sanda sanda at lyx.org
Thu Aug 20 06:47:05 UTC 2020


commit 4cd3ab1b1ac28c4236cc7f37903d746f3e3fa211
Author: Pavel Sanda <sanda at lyx.org>
Date:   Thu Aug 20 09:11:07 2020 +0200

    Example script for looking up the citation pdfs.
---
 lib/scripts/lyxpaperview |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/lib/scripts/lyxpaperview b/lib/scripts/lyxpaperview
new file mode 100755
index 0000000..29093da
--- /dev/null
+++ b/lib/scripts/lyxpaperview
@@ -0,0 +1,26 @@
+#!/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.
+#
+#Syntax: paperview AuthorName Year
+#Output: absolute path to the file(s)
+#
+#Dependencies: 
+#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} &
+


More information about the lyx-cvs mailing list