summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-06-22 00:05:31 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-06-22 00:05:31 +0200
commit5c9b859165af46407543b25589ce8852ee079620 (patch)
tree28998698986312e101e15ca57e55e944200a3d8f /scripts
parentd11a1200ed28c6e0058990a621d7404f821ac7fd (diff)
downloadcontext-5c9b859165af46407543b25589ce8852ee079620.tar.gz
2017-06-21 23:09:00
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtx-context.lua14
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua
index a0d7ea145..fac310df2 100644
--- a/scripts/context/lua/mtx-context.lua
+++ b/scripts/context/lua/mtx-context.lua
@@ -440,13 +440,23 @@ local function pdf_open(name,method)
pdfview = pdfview or dofile(resolvers.findfile("l-pdfview.lua","tex"))
pdfview.setmethod(method)
report(pdfview.status())
- pdfview.open(filenewsuffix(name,"pdf"))
+ local pdfname = filenewsuffix(name,"pdf")
+ if lfs.isfile(pdfname) then
+ pdfview.open(pdfname)
+ end
+ pdfname = name .. ".pdf" -- agressive
+ pdfview.open(pdfname)
end
local function pdf_close(name,method)
pdfview = pdfview or dofile(resolvers.findfile("l-pdfview.lua","tex"))
pdfview.setmethod(method)
- pdfview.close(filenewsuffix(name,"pdf"))
+ local pdfname = filenewsuffix(name,"pdf")
+ if lfs.isfile(pdfname) then
+ pdfview.close(pdfname)
+ end
+ pdfname = name .. ".pdf" -- agressive
+ pdfview.close(pdfname)
end
-- result file handling