summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-06-10 21:34:06 +0000
committerKarl Berry <karl@freefriends.org>2017-06-10 21:34:06 +0000
commit0a543d44f49029704fe666953858d028b000d5d2 (patch)
treeccb8c9d5504de05b302302db32fd970f92148f9a /Master/texmf-dist/tex/latex
parentd8d28aa3d46f4ab90e745b504027ee820bea0bc2 (diff)
lwarp (10jun17)
git-svn-id: svn://tug.org/texlive/trunk@44552 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/lwarp/lwarp.sty59
1 files changed, 36 insertions, 23 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp.sty
index 6e15502dd1d..bad047aecbf 100644
--- a/Master/texmf-dist/tex/latex/lwarp/lwarp.sty
+++ b/Master/texmf-dist/tex/latex/lwarp/lwarp.sty
@@ -17,7 +17,7 @@
%% version 2005/12/01 or later.
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{lwarp}
- [2017/05/15 v0.31 Allows LaTeX to directly produce HTML5 output.]
+ [2017/06/09 v0.32 Allows LaTeX to directly produce HTML5 output.]
@@ -390,19 +390,20 @@ top=1in,bottom=1in,%
\newcommand*\LWR@findword[3][,]{%
\StrBetween[#3,\numexpr#3+1]{#1#2#1}{#1}{#1}%
}
-\newcommand*{\LWR@lookforpackagename}[1]{
-\LWR@findword{\LWR@requirepackagenames}{#1}[\LWR@strresult]
-\IfStrEq{\LWR@strresult}{}
+\newcommand*{\LWR@lookforpackagename}[1]{%
+\LWR@findword{\LWR@requirepackagenames}{#1}[\LWR@strresult]%
+\StrSubstitute[100]{\LWR@strresult}{ }{}[\LWR@strresulttwo]%
+\IfStrEq{\LWR@strresulttwo}{}%
{}% no filename
{% yes filename
-\IfFileExists{lwarp-\LWR@strresult.sty}
-{% latex_html_ file found
-\StrSubstitute
-{\LWR@requirepackagenames}
-{\LWR@strresult}
-{lwarp-\LWR@strresult}[\LWR@requirepackagenames]
-}
-{}% no latex_html_* file
+\IfFileExists{lwarp-\LWR@strresulttwo.sty}%
+{% lwarp-* file found
+\StrSubstitute%
+{\LWR@requirepackagenames}%
+{\LWR@strresult}%
+{lwarp-\LWR@strresulttwo}[\LWR@requirepackagenames]%
+}%
+{}% no lwarp-* file
}% yes filename
}
\RenewDocumentCommand{\RequirePackage}{o m o}{%
@@ -2286,7 +2287,7 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-
-- Print the usage of the lwarpmk command:
-printversion = "v0.31"
+printversion = "v0.32"
function printhelp ()
print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ;
@@ -2343,9 +2344,9 @@ end
function splitfile (destfile,sourcefile)
print ("lwarpmk: Splitting " .. sourcefile .. " into " .. destfile) ;
-io.input(sourcefile)
+local sfile = io.open(sourcefile)
io.output(destfile)
-for line in io.lines() do
+for line in sfile:lines() do
i,j,copen,cstart,newfilename = string.find (line,"(.*)|(.*)|(.*)|") ;
if ( (i~= nil) and (copen == "<!--") and (cstart == "Start file")) then -- split the file
io.output(newfilename) ;
@@ -2353,6 +2354,7 @@ else -- not a splitpoint
io.write (line .. "\n") ;
end
end -- do
+io.close(sfile)
end -- function
-- Incorrect value, so print an error and exit.
@@ -2384,10 +2386,10 @@ os.exit(1) -- exit the entire lwarpmk script
else -- file exists
-- Read the file:
print ("lwarpmk: Reading " .. conffile ..".")
-io.input(conffile) ;
+local cfile = io.open(conffile)
-- Scan each line:
local linenum = 0
-for line in io.lines() do -- scan lines
+for line in cfile:lines() do -- scan lines
linenum = linenum + 1
i,j,cvarname,cvalue = string.find (line,"([%w-_]*)%s*=%s*\"([%w%-_%.]*)\"") ;
-- Error if incorrect enclosing characters:
@@ -2428,6 +2430,7 @@ printconf () ;
os.exit(1) ;
end
end -- do scan lines
+io.close(cfile)
end -- file exists
-- Select some operating-system commands:
if opsystem=="Unix" then -- For Unix / Linux / Mac OS:
@@ -2467,10 +2470,14 @@ end
-- Return true if found.
function reruntoget (filesource)
-io.input(filesource)
-for line in io.lines() do
-if ( string.find(line,"Rerun to get") ~= nil ) then return true end
+local fsource = io.open(filesource)
+for line in fsource:lines() do
+if ( string.find(line,"Rerun to get") ~= nil ) then
+io.close(fsource)
+return true
+end
end
+io.close(fsource)
return false
end
@@ -2537,11 +2544,11 @@ end
-- Create lateximages based on lateximages.txt:
function createlateximages ()
print ("lwarpmk: Creating lateximages.")
-io.input("lateximages.txt")
--- Create the lateximages directory, ignore error if alreadt exists
+local limagesfile = io.open("lateximages.txt")
+-- Create the lateximages directory, ignore error if already exists
err = os.execute("mkdir lateximages")
-- Scan lateximages.txt
-for line in io.lines() do
+for line in limagesfile:lines() do
-- lwimgpage is the page number in the PDF which has the image
-- lwimgnum is the sequential lateximage number to assign for the image
i,j,lwimgpage,lwimgnum = string.find (line,"|(.*)|(.*)|")
@@ -2569,6 +2576,7 @@ rmname .. " lateximage-" .. lwimgnum ..".pdf lateximagetemp-" .. lwimgpage ..".p
if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end
end
end -- do
+io.close(limagesfile)
end -- function
-- Use latexmk to compile source and index:
@@ -4888,6 +4896,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}%
\newcommand*{\LWR@tablecolspec}{}
\newcommand*{\LWR@strresult}{}
+\newcommand*{\LWR@strresulttwo}{}
\newcommand*{\LWR@origcolspec}{}
@@ -5975,6 +5984,10 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}%
\newcommand{\hyperindexref}[1]{#1}
\end{warpprint}
+\begin{warpall}
+\providecommand{\glo@name}{}
+\end{warpall}
+
\begin{warpHTML}