From 5c9b859165af46407543b25589ce8852ee079620 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 22 Jun 2017 00:05:31 +0200 Subject: 2017-06-21 23:09:00 --- scripts/context/lua/mtx-context.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts') 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 -- cgit v1.2.3