From 36c3a7f80fb543246ba005efd3dc2e4046861e1a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 2 Apr 2018 21:21:55 +0000 Subject: lwarp (2apr18) git-svn-id: svn://tug.org/texlive/trunk@47250 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/lwarp/lwarp.dtx | 60 +++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 6 deletions(-) (limited to 'Master/texmf-dist/source/latex/lwarp') diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx index 9e314321fcf..1e3513dbea3 100644 --- a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx +++ b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx @@ -16,7 +16,7 @@ % \iffalse %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{lwarp} -% [2018/04/01 v0.52 Allows LaTeX to directly produce HTML5 output.] +% [2018/04/01 v0.53 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -2062,7 +2062,7 @@ This boolean may be tested by the user for later use. %<*package> % \fi % -% \CheckSum{23333} +% \CheckSum{23337} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -2156,6 +2156,7 @@ This boolean may be tested by the user for later use. % \changes{v0.50}{2018/03/03}{\ 2018/03/03} % \changes{v0.51}{2018/03/24}{\ 2018/03/24} % \changes{v0.52}{2018/04/01}{\ 2018/04/01} +% \changes{v0.53}{2018/04/01}{\ 2018/04/01} @@ -2349,6 +2350,15 @@ This boolean may be tested by the user for later use. % % \begin{description} % \needspace{2\baselineskip} +% \item[v0.53:] \ +% \begin{itemize} +% \item \prog{lwarpmk}: Added a warning about corrupted images due to the +% \margintag{\prog{lwarpmk}} +% need to recompile the document one more time. +% \item \prog{lwarpmk}: Added the \cmds{lwarpmk cleanlimages} command. +% \item Added documentation for \cmds{lwarpmk cleanlimages} and +% \cmds{lwarpmk pdftohtml}. +% \end{itemize} % \item[v0.52:] \ % \begin{itemize} % \item Improved install instructions regarding \filenm{lwarp\_baseline\_marker.png}. @@ -4569,6 +4579,23 @@ This boolean may be tested by the user for later use. % \userentry{lwarpmk cleanall} % % +% \subsection{Cleaning the images from the \filenm{lateximages} directory} +% \changes{v0.53}{2018/04/01}{Docs: \cmds{lwarpmk cleanlimages}.} +% +% To remove the images from the \filenm{lateximages} directory, including +% all \SVG\ math images: +% \userentry{lwarpmk cleanlimages} +% +% +% \subsection{Creating HTML from an incomplete compile} +% \changes{v0.53}{2018/04/01}{Docs: \cmds{lwarpmk pdftohtml}.} +% +% During testing it may be useful to finish the \HTML\ conversion even when +% the document had errors and did not compile successfully. To attempt an +% \HTML\ conversion of an incomplete document: +% \userentry{lwarpmk pdftohtml [project]} +% +% % \subsection{Processing multiple projects in the same directory} % % It is possible to have several projects in the same directory. @@ -11838,6 +11865,8 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX- % \changes{v0.51}{2018/03/16}{\prog{lwarpmk}: \prog{pdftocairo} \optn{-noshrink} added.} % \changes{v0.52}{2018/03/31}{\prog{lwarpmk}: Fix: Memory overflow when spawning tasks.} % \changes{v0.52}{2018/04/01}{\prog{lwarpmk}: Fix: Skip image generation if from page 0.} +% \changes{v0.53}{2018/04/01}{\prog{lwarpmk}: Adds warning for corrupted images.} +% \changes{v0.53}{2018/04/01}{\prog{lwarpmk}: Adds \cmds{lwarpmk cleanlimages}.} % % The following is only generated if the \optn{lwarpmk} option % was given to \pkg{lwarp}. @@ -11854,7 +11883,7 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX- -- Print the usage of the lwarpmk command: -printversion = "v0.52" +printversion = "v0.53" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; @@ -11875,10 +11904,11 @@ lwarpmk again [project]: Touch the source code to trigger recompiles. lwarpmk limages [project]: Process the "lateximages" created by lwarp.sty. lwarpmk pdftohtml [project]: For use with latexmk or a Makefile: - Convert project_html.pdf to project_html.html and - individual HTML files. + Converts project_html.pdf to project_html.html and individual HTML files. + Finishes the HTML conversion even if there was a compile error. lwarpmk clean [project]: Remove .aux, .toc, .lof/t, .idx, .ind, .log, *_html_inc.*, .gl* lwarpmk cleanall [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. @@ -12192,6 +12222,8 @@ if opsystem=="Windows" then end -- create lwarp_one_limage.cmd -- Track the number of parallel processes numimageprocesses = 0 +-- Track warning to recompile if find a page 0 +pagezerowarning = false -- Scan lateximages.txt for line in limagesfile:lines() do -- lwimgpage is the page number in the PDF which has the image @@ -12201,7 +12233,9 @@ i,j,lwimgpage,lwimghash,lwimgname = string.find (line,"|(.*)|(.*)|(.*)|") -- For each entry: if ( (i~=nil) ) then -- Skip if the page number is 0: -if ( lwimgpage ~= "0" ) then +if ( lwimgpage == "0" ) then + pagezerowarning = true +else -- Skip is this image is hashed and already exists: local lwimgfullname = "lateximages" .. dirslash .. lwimgname .. ".svg" if ( @@ -12282,6 +12316,12 @@ end -- not nil end -- do io.close(limagesfile) print ( "lwarpmk limages: done" ) +if ( pagezerowarning == true ) then + print ( "lwarpmk limages: WARNING: Images will be incorrect." ) + print ( "lwarpmk limages: Enter \"lwarpmk cleanlimages\", then" ) + print ( "lwarpmk limages: recompile the document one more time, then" ) + print ( "lwarpmk limages: repeat \"lwarpmk images\" again." ) +end -- pagezerowarning end -- function @@ -12498,6 +12538,14 @@ os.execute ( rmname .. " " .. ) print ("lwarpmk: Done.") +-- lwarpmk cleanlimages +-- Remove images from the lateximages directory. + +elseif arg[1] == "cleanlimages" then +loadconf () +os.execute ( rmname .. " lateximages/*" ) +print ("lwarpmk: Done.") + -- lwarpmk with no argument : elseif (arg[1] == nil) then -- cgit v1.2.3