Skip to content

Commit 6ce3819

Browse files
committed
lwarp (6mar19)
git-svn-id: svn://tug.org/texlive/trunk/Build/source@50266 c570f23f-e606-0410-a88d-b1316a301751
1 parent f7c1004 commit 6ce3819

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

texk/texlive/linked_scripts/lwarp/lwarpmk.lua

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
-- Copyright 2016-2018 Brian Dunn
44

5-
printversion = "v0.67"
5+
printversion = "v0.68"
66
requiredconfversion = "2" -- also at *lwarpmk.conf
77

88
function printhelp ()
@@ -396,6 +396,15 @@ function warnlimages ()
396396
print ("lwarpmk: ===")
397397
end -- warnlimages
398398

399+
function warnlimagesrecompile ()
400+
-- Warning if must recompile before creating limages:
401+
print ("")
402+
print ("lwarpmk: ===")
403+
print ("lwarpmk: The document must be recompiled before creating the lateximages.")
404+
print ("lwarpmk: Enter \"lwarpmk html\" again, then try \"lwarpmk limages\" again.")
405+
print ("lwarpmk: ===")
406+
end --warnlimagesrecompile
407+
399408
function checklimages ()
400409
--
401410
-- Check <sourcename>.txt to see if need to recompile first.
@@ -424,12 +433,14 @@ for line in limagesfile:lines() do
424433
end
425434
end -- if i~=nil
426435
end -- do
436+
-- The last line should be |end|end|end|.
437+
-- If not, the compile must have aborted, and the images are incomplete.
438+
if ( lwimgpage ~= "end" ) then
439+
warnlimagesrecompile()
440+
os.exit(1) ;
441+
end
427442
if ( pagezerowarning ) then
428-
print ("")
429-
print ("lwarpmk: ===")
430-
print ("lwarpmk: The document must be recompiled before creating the lateximages.")
431-
print ("lwarpmk: Enter \"lwarpmk html\" again, then try \"lwarpmk limages\" again.")
432-
print ("lwarpmk: ===")
443+
warnlimagesrecompile()
433444
os.exit(1) ;
434445
end -- pagezerowarning
435446
end -- checklimages
@@ -509,6 +520,8 @@ if ( (i~=nil) ) then
509520
-- Skip if the page number is 0:
510521
if ( lwimgpage == "0" ) then
511522
pagezerowarning = true
523+
-- Skip if the page number is "end":
524+
else if ( lwimgpage == "end" ) then
512525
else
513526
-- Skip is this image is hashed and already exists:
514527
local lwimgfullname = imagesdirectory .. dirslash .. lwimgname .. ".svg"
@@ -531,6 +544,7 @@ if ( (i~=nil) ) then
531544
createwindowsimage (lwimgfullname)
532545
end
533546
end -- not hashed or not exists
547+
end -- not page "end"
534548
end -- not page 0
535549
end -- not nil
536550
end -- createonelateximage

0 commit comments

Comments
 (0)