summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/lwarp
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/source/latex/lwarp
parentd8d28aa3d46f4ab90e745b504027ee820bea0bc2 (diff)
lwarp (10jun17)
git-svn-id: svn://tug.org/texlive/trunk@44552 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/lwarp')
-rw-r--r--Master/texmf-dist/source/latex/lwarp/lwarp.dtx88
1 files changed, 63 insertions, 25 deletions
diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx
index d974635bdcd..a956f0a45f7 100644
--- a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx
+++ b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx
@@ -16,7 +16,7 @@
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{lwarp}
-%<package> [2017/05/15 v0.31 Allows LaTeX to directly produce HTML5 output.]
+%<package> [2017/06/09 v0.32 Allows LaTeX to directly produce HTML5 output.]
%
%<*driver>
\documentclass{ltxdoc}
@@ -972,7 +972,7 @@ This boolean may be tested by the user for later use.
%<*package>
% \fi
%
-% \CheckSum{10985}
+% \CheckSum{10994}
%
% \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
@@ -1042,6 +1042,7 @@ This boolean may be tested by the user for later use.
% \changes{v0.29}{2017/04/15}{\ 2017/04/15}
% \changes{v0.30}{2017/04/29}{\ 2017/04/29}
% \changes{v0.31}{2017/05/15}{\ 2017/05/15}
+% \changes{v0.32}{2017/06/09}{\ 2016/06/09}
@@ -1175,7 +1176,13 @@ This boolean may be tested by the user for later use.
% For a detailed list of changes, see the Change History on page \pageref{sec:changehistory}.
%
% \begin{description}
-% \item[v0.31:] \
+% \item[v0.32:] Bug fixes; no source changes needed:
+% \begin{itemize}
+% \item |lwarpmk| has been adjusted to work with the latest |luatex|.
+% \item Spaces in the \cs{usepackage} and \cs{RequirePackage} package lists are now accepted and ignored.
+% \item Fix for the \pkg{glossaries} package and \cs{glo@name}.
+% \end{itemize}
+% \item[v0.31:] Bug fix; no source changes needed:
% \begin{itemize}
% \item Improved compatibility with \pkg{keyfloat},
% including the new \env{keywrap} environment.
@@ -5489,28 +5496,34 @@ top=1in,bottom=1in,%
% If this is a package name, re-direct it to the \pkg{lwarp} version
% by renaming it |lwarp-| followed by the original name.
% \begin{macrocode}
-\newcommand*{\LWR@lookforpackagename}[1]{
+\newcommand*{\LWR@lookforpackagename}[1]{%
% \end{macrocode}
% Find the n'th package name from the list:
% \begin{macrocode}
-\LWR@findword{\LWR@requirepackagenames}{#1}[\LWR@strresult]
+\LWR@findword{\LWR@requirepackagenames}{#1}[\LWR@strresult]%
+% \end{macrocode}
+% Remove blanks.
+% The original name with blanks is in |LWR@strresult| and
+% the final name with no blanks goes into |LWR@strresulttwo|.
+% \begin{macrocode}
+\StrSubstitute[100]{\LWR@strresult}{ }{}[\LWR@strresulttwo]%
% \end{macrocode}
% See if the package name was found:
% \begin{macrocode}
-\IfStrEq{\LWR@strresult}{}
+\IfStrEq{\LWR@strresulttwo}{}%
{}% no filename
{% yes filename
% \end{macrocode}
% If found, and if an \pkg{lwarp}-equivalent name exists, use |lwarp-|* instead.
% \begin{macrocode}
-\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
}
% \end{macrocode}
@@ -5523,6 +5536,8 @@ top=1in,bottom=1in,%
% if an \pkg{lwarp} version of a package exists,
% select it instead of the \LaTeX\ version.
%
+% \changes{v0.32}{2017/06/09}{Fix: Ignores blanks in package list.}
+%
% \begin{macrocode}
\RenewDocumentCommand{\RequirePackage}{o m o}{%
% \end{macrocode}
@@ -7819,6 +7834,8 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-
% \changes{v0.30}{2017/04/28}{\protect\texttt{lwarpmk}: Fix: \protect\texttt{xindy} and \protect\texttt{texindy}
% adjusted for \protect\texttt{pdflatex}, \protect\texttt{xelatex} and \protect\texttt{lualatex}.}
% \changes{v0.30}{2017/04/28}{\protect\texttt{lwarpmk}: Add: \protect\texttt{xdyfile} configuration option.}
+% \changes{v0.32}{2017/06/08}{\protect\texttt{lwarpmk}: Fix: \protect\texttt{io.lines()} changed to \protect\texttt{file:lines()}
+% due to \protect\texttt{luatex} changes.}
%
% \begin{macrocode}
\begin{VerbatimOut}{lwarpmk.lua}
@@ -7828,7 +7845,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.") ;
@@ -7886,9 +7903,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) ;
@@ -7896,6 +7913,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.
@@ -7927,10 +7945,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:
@@ -7971,6 +7989,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:
@@ -8012,10 +8031,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
@@ -8088,11 +8111,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,"|(.*)|(.*)|")
@@ -8120,6 +8143,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
@@ -13124,6 +13148,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}%
% \begin{macro}{\LWR@strresult} Holds the result of |Str| functions.
% \begin{macrocode}
\newcommand*{\LWR@strresult}{}
+\newcommand*{\LWR@strresulttwo}{}
% \end{macrocode}
% \end{macro}
@@ -15854,6 +15879,19 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}%
+% \codeall
+%
+% For the \pkg{glossaries} package, try to prevent an error where
+% \cs{glo@name} was not found:
+%
+% \changes{v0.32}{2017/06/08}{\pkg{glossaries}: Prevent error with \cs{glo@name} not defined.}
+% \begin{macrocode}
+\begin{warpall}
+\providecommand{\glo@name}{}
+\end{warpall}
+% \end{macrocode}
+
+
% \section{Math}
% \label{sec:math}