diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-06-22 00:05:31 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-06-22 00:05:31 +0200 |
commit | 5c9b859165af46407543b25589ce8852ee079620 (patch) | |
tree | 28998698986312e101e15ca57e55e944200a3d8f /scripts | |
parent | d11a1200ed28c6e0058990a621d7404f821ac7fd (diff) | |
download | context-5c9b859165af46407543b25589ce8852ee079620.tar.gz |
2017-06-21 23:09:00
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtx-context.lua | 14 |
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 |