#!/usr/bin/env texlua -- Copyright 2016-2018 Brian Dunn printversion = "v0.58" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; end function printusage () -- -- Print the usage of the lwarpmk command: -- print ( [[ lwarpmk print [-p project]: Compile the print version if necessary. lwarpmk print1 [-p project]: Forced single compile of the print version. lwarpmk printindex [-p project]: Process print indexes. lwarpmk printglossary [-p project]: Process the glossary for the print version. lwarpmk html [-p project]: Compile the HTML version if necessary. lwarpmk html1 [-p project]: Forced single compile of the HTML version. lwarpmk htmlindex [-p project]: Process HTML indexes. lwarpmk htmlglossary [-p project]: Process the glossary for the html version. lwarpmk again [-p project]: Touch the source code to trigger recompiles. lwarpmk limages [-p project]: Process the "lateximages" created by lwarp.sty. lwarpmk pdftohtml [-p project]: For use with latexmk or a Makefile: Converts project_html.pdf to project_html.html and individual HTML files. Finishes the HTML conversion even if there was a compile error. lwarpmk pdftosvg : Converts each PDF file to SVG. lwarpmk clean [-p project]: Remove .aux, .toc, .lof/t, .idx, .ind, .log, *_html_inc.*, .gl* lwarpmk cleanall [-p project]: Remove auxiliary files and also project.pdf, *.html lwarpmk cleanlimages: Removes all images from the "lateximages" directory. lwarpmk -h: Print this help message. lwarpmk --help: Print this help message. ]] ) -- printconf () end -- function printconf () -- -- -- -- Print the format of the configuration file lwarpmk.conf: -- -- -- print ( [[ -- An example lwarpmk.conf or .lwarpmkconf project file: -- -- -- opsystem = "Unix" (or "Windows") -- latexname = "pdflatex" (or "lualatex", or "xelatex") -- sourcename = "projectname" (the source-code filename w/o .tex) -- homehtmlfilename = "index" (or perhaps the project name) -- htmlfilename = "" (or "projectname" - filename prefix) -- latexmk = "false" (or "true" to use latexmk to build PDFs) -- shellescape = "false" -- printindexcmd = "makeindex -s lwarp.ist .idx" -- HTMLindexcmd = "makeindex -s lwarp.ist _html.idx" -- latexmkindexcmd = "makeindex -s lwarp.ist" -- -- indexprog = "makeindex" or "xindy" -- -- makeindexstyle = "lwarp.ist" (or a custom file based on lwarp.ist) -- -- xindylanguge = "english" (use a language supported by xindy) -- -- xindycodepage = "utf8" (use a codepage supported by xindy) -- -- xindystyle = "lwarp.xdy" (or a custom file based on lwarp.xdy) -- glossarycmd = "makeglossaries" -- pdftotextenc = "UTF-8" (use an encoding supported by pdftotext) -- -- -- Filenames must contain only letters, numbers, underscore, or dash. -- Values must be in upright "quotes". -- -- ]] ) ; -- end function splitfile (destfile,sourcefile) -- -- Split one large sourcefile into a number of files, -- starting with destfile. -- The file is split at each occurance of