22
33-- Copyright 2016-2018 Brian Dunn
44
5- printversion = " v0.67 "
5+ printversion = " v0.68 "
66requiredconfversion = " 2" -- also at *lwarpmk.conf
77
88function printhelp ()
@@ -396,6 +396,15 @@ function warnlimages ()
396396 print (" lwarpmk: ===" )
397397end -- 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+
399408function 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
426435end -- 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
427442if ( 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 ) ;
434445end -- pagezerowarning
435446end -- 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
535549end -- not nil
536550end -- createonelateximage
0 commit comments