summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lwarp
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-07-04 21:23:20 +0000
committerKarl Berry <karl@freefriends.org>2021-07-04 21:23:20 +0000
commitf262a7d129a86f7fa0eb16a7106ee426eee88d42 (patch)
treec93c9239fd5c147daf43ac9b0d5fec878956c25a /Master/texmf-dist/tex/latex/lwarp
parent2026845171ebe3af57cd37c7d03ebf1b2970a62c (diff)
lwarp
git-svn-id: svn://tug.org/texlive/trunk@59834 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp')
-rw-r--r--Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty136
-rw-r--r--Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty35
-rw-r--r--Master/texmf-dist/tex/latex/lwarp/lwarp.sty47
3 files changed, 140 insertions, 78 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty
index 8611329fb78..6a5d70df83e 100644
--- a/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty
+++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty
@@ -50,6 +50,10 @@
\newcommand*{\LWR@igangle}{}
\newcommand*{\LWR@igxscale}{1}
\newcommand*{\LWR@igyscale}{1}
+
+\newbool{LWR@igkeepaspectratio}
+\boolfalse{LWR@igkeepaspectratio}
+
\newcommand*{\LWR@igclass}{inlineimage}
\newcommand*{\LWR@igalt}{\ImageAltText}
@@ -93,6 +97,9 @@
{}% not px
}{}% end of length > 0pt
}
+\define@key{igraph}{keepaspectratio}[false]{%
+ \booltrue{LWR@igkeepaspectratio}%
+}
\define@key{igraph}{origin}[c]{%
\renewcommand*{\LWR@igorigin}{#1}%
}
@@ -120,7 +127,6 @@
\define@key{igraph}{viewport}{}
\define@key{igraph}{trim}{}
\define@key{igraph}{totalheight}{}
-\define@key{igraph}{keepaspectratio}[true]{}
\define@key{igraph}{clip}[true]{}
\define@key{igraph}{draft}[true]{}
\define@key{igraph}{type}{}
@@ -170,83 +176,81 @@
}%
}
-\newcommand*{\LWR@ig@wpimagesizes}[4]{%
- \ifbool{FormatWP}{%
- \begingroup%
- \LWR@restoreorigformatting%
- \ifpdf%
- \appto\LWR@restoreorigformatting{%
- \DeclareGraphicsExtensions{%
- .pdf,.PDF,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG%
- }%
+\newcommand*{\LWR@ig@useactualimagesize}[4]{%
+ \begingroup%
+ \LWR@restoreorigformatting%
+ \ifpdf%
+ \appto\LWR@restoreorigformatting{%
+ \DeclareGraphicsExtensions{%
+ .pdf,.PDF,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG%
}%
- \else% \ifpdf
- \ifXeTeX%
- \appto\LWR@restoreorigformatting{%
- \DeclareGraphicsExtensions{%
- .pdf,.PDF,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG%
- }%
+ }%
+ \else% \ifpdf
+ \ifXeTeX%
+ \appto\LWR@restoreorigformatting{%
+ \DeclareGraphicsExtensions{%
+ .pdf,.PDF,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG%
}%
- \else%
- \appto\LWR@restoreorigformatting{%
- \DeclareGraphicsExtensions{%
- .eps,.EPS,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG%
+ }%
+ \else%
+ \appto\LWR@restoreorigformatting{%
+ \DeclareGraphicsExtensions{%
+ .eps,.EPS,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG%
+ }%
+ }%
+ \fi%
+ \fi% \ifpdf
+ \ifbool{FormatWP}{\define@key{Gin}{angle}{}}{}%
+ \IfBooleanTF{#1}%
+ {% starred
+ \IfValueTF{#3}%
+ {%
+ \global\sbox{\LWR@imagesizebox}{%
+ \LWR@origincludegraphics*[#2][#3]{#4}%
}%
}%
- \fi%
- \fi% \ifpdf
- \define@key{Gin}{angle}{}%
- \IfBooleanTF{#1}%
- {% starred
- \IfValueTF{#3}%
+ {%
+ \IfValueTF{#2}%
{%
\global\sbox{\LWR@imagesizebox}{%
- \LWR@origincludegraphics*[#2][#3]{#4}%
+ \LWR@origincludegraphics*[#2]{#4}%
}%
- }%
- {%
- \IfValueTF{#2}%
- {%
- \global\sbox{\LWR@imagesizebox}{%
- \LWR@origincludegraphics*[#2]{#4}%
- }%
- }{%
- \global\sbox{\LWR@imagesizebox}{%
- \LWR@origincludegraphics*{#4}%
- }%
+ }{%
+ \global\sbox{\LWR@imagesizebox}{%
+ \LWR@origincludegraphics*{#4}%
}%
}%
- }% starred
- {% not starred
- \IfValueTF{#3}%
+ }%
+ }% starred
+ {% not starred
+ \IfValueTF{#3}%
+ {%
+ \global\sbox{\LWR@imagesizebox}{%
+ \LWR@origincludegraphics[#2][#3]{#4}%
+ }%
+ }%
+ {%
+ \IfValueTF{#2}%
{%
\global\sbox{\LWR@imagesizebox}{%
- \LWR@origincludegraphics[#2][#3]{#4}%
+ \LWR@origincludegraphics[#2]{#4}%
}%
- }%
- {%
- \IfValueTF{#2}%
- {%
- \global\sbox{\LWR@imagesizebox}{%
- \LWR@origincludegraphics[#2]{#4}%
- }%
- }{%
- \global\sbox{\LWR@imagesizebox}{%
- \LWR@origincludegraphics{#4}%
- }%
+ }{%
+ \global\sbox{\LWR@imagesizebox}{%
+ \LWR@origincludegraphics{#4}%
}%
}%
- }% not starred
- \endgroup%
- \settowidth{\LWR@igwidth}{\usebox{\LWR@imagesizebox}}%
- \global\renewcommand*{\LWR@igwidthstyle}{%
- width:\LWR@printlength{\LWR@igwidth}%
- }%
- \settoheight{\LWR@igheight}{\usebox{\LWR@imagesizebox}}%
- \global\renewcommand*{\LWR@igheightstyle}{%
- height:\LWR@printlength{\LWR@igheight}%
}%
- }{}% FormatWP
+ }% not starred
+ \endgroup%
+ \settowidth{\LWR@igwidth}{\usebox{\LWR@imagesizebox}}%
+ \global\renewcommand*{\LWR@igwidthstyle}{%
+ width:\LWR@printlength{\LWR@igwidth}%
+ }%
+ \settoheight{\LWR@igheight}{\usebox{\LWR@imagesizebox}}%
+ \global\renewcommand*{\LWR@igheightstyle}{%
+ height:\LWR@printlength{\LWR@igheight}%
+ }%
}
\newcommand*{\LWR@ig@htmltag}{%
@@ -316,6 +320,7 @@
\renewcommand*{\LWR@igxscale}{1}%
\renewcommand*{\LWR@igyscale}{1}%
\renewcommand*{\LWR@igclass}{inlineimage}%
+ \boolfalse{LWR@igkeepaspectratio}%
\ifdefvoid{\LWR@ThisAltText}{%
\edef\LWR@igalt{\ImageAltText}%
}{%
@@ -338,7 +343,10 @@
\filename@parse{\LWR@parsedfilename}%
\StrSubstitute{\LWR@parsedfilename}{//}{/}[\LWR@parsedfilename]%
\LWR@traceinfo{LWR@parsedfilename is \LWR@parsedfilename}%
- \LWR@ig@wpimagesizes{#1}{#2}{#3}{#4}%
+ \ifboolexpr{
+ bool {FormatWP} or
+ bool {LWR@igkeepaspectratio}
+ }{\LWR@ig@useactualimagesize{#1}{#2}{#3}{#4}}{}%
\LWR@traceinfo{LWR@includegraphicsb: about to create href}%
\LWR@href{\LWR@parsedfilename}%
{% start of href
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty
index 0e7fdfb75bf..63ffeb1ef23 100644
--- a/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty
+++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty
@@ -52,10 +52,10 @@
\renewcommand*{\KFLT@maybeendfloatrow}{%
\ifnumless{\value{KFLT@thiscol}}{\value{KFLT@numcols}}%
- {}% thiscol < numcols
- {% >=
- \defcounter{KFLT@thiscol}{0}%
- }%
+ {}% thiscol < numcols
+ {% >=
+ \defcounter{KFLT@thiscol}{0}%
+ }%
}%
\renewcommand{\KFLT@trackrows}%
@@ -78,17 +78,34 @@
\LWR@traceinfo{KFLT@onefigureimage}%
\ifthenelse{\NOT\equal{\KFLT@lw}{}}%
{%
- \KFLT@frame{\includegraphics%
- [scale=\KFLT@s,width=\KFLT@imagewidth]{#1}}%
+ \ifdimgreater{\KFLT@h}{0pt}%
+ {%
+ \KFLT@frame{%
+ \includegraphics%
+ [%
+ scale=\KFLT@s,%
+ width=\KFLT@imagewidth,%
+ height=\KFLT@h,%
+ \KFLT@keepaspectratio,%
+ ]{#1}%
+ }%
+ }%
+ {%
+ \KFLT@frame{\includegraphics%
+ [scale=\KFLT@s,width=\KFLT@imagewidth]{#1}}%
+ }%
}%
{% not linewidth
\ifthenelse{\dimtest{\KFLT@w}{>}{0pt}}%
{% width is given
\ifthenelse{\dimtest{\KFLT@h}{>}{0pt}}%
{% w and h
- \KFLT@frame{\includegraphics%
- [scale=\KFLT@s,%
- width=\KFLT@imagewidth,height=\KFLT@h]{#1}}%
+ \KFLT@frame{\includegraphics[%
+ scale=\KFLT@s,%
+ width=\KFLT@imagewidth,%
+ height=\KFLT@h,%
+ \KFLT@keepaspectratio,%
+ ]{#1}}%
}% w and h
{% only w
\KFLT@frame{\includegraphics%
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp.sty
index 060b7db4a7e..a373b87d3c8 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}
- [2021/05/24 v0.898 Allows LaTeX to directly produce HTML5 output.]
+ [2021/06/29 v0.899 Allows LaTeX to directly produce HTML5 output.]
@@ -3674,8 +3674,11 @@ section.textbody { margin: 0ex 1em 0ex 1em ;}
div.multicolsheading { -webkit-column-span: all;
-moz-column-span: all; column-span: all; }
-div.multicols { -webkit-columns: 3 380px ;
- -moz-columns: 3 380px ; columns: 3 380px ; }
+div.multicols {
+ -webkit-columns: 3 auto ;
+ -moz-columns: 3 auto ;
+ columns: 3 auto ;
+}
div.multicols p {margin-top: 0ex}
/* Used for xfrac and nicefrac: */
@@ -3965,6 +3968,14 @@ nav.botnavigation { display:none; }
/* Only display the sidetoc's webpage title if a small screen */
span.sidetocthetitle { display: none }
+@media screen and (max-width: 100em) {
+ div.multicols {
+ -webkit-columns: 2 auto ;
+ -moz-columns: 2 auto ;
+ columns: 2 auto ;
+ }
+}
+
@media screen and (max-width: 50em) {
div.sidetoccontainer {
float: none ;
@@ -3985,6 +3996,11 @@ span.sidetocthetitle { display: none }
display:block ;
margin: 1ex 1em 1ex 1em ;
}
+ div.multicols {
+ -webkit-columns: 1 auto ;
+ -moz-columns: 1 auto ;
+ columns: 1 auto ;
+ }
}
@media print {
@@ -4746,7 +4762,7 @@ MathJax = {
-- Copyright 2016-2021 Brian Dunn
-printversion = "v0.898"
+printversion = "v0.899"
requiredconfversion = "2" -- also at *lwarpmk.conf
function printhelp ()
@@ -4810,7 +4826,9 @@ function splitfile (destfile,sourcefile)
-- Split one large sourcefile into a number of files,
-- starting with destfile.
-- The file is split at each occurance of <!--|Start file|newfilename|*
+-- If lwarp is in use, sets usinglwarp.
--
+usinglwarp = false ;
print ("lwarpmk: Splitting " .. sourcefile .. " into " .. destfile) ;
local sfile = io.open(sourcefile)
io.output(destfile)
@@ -4820,11 +4838,23 @@ if ( (i~= nil) and (copen == "<!--") and (cstart == "Start file")) then
-- split the file
io.output(newfilename) ;
else
+if ( (i~= nil) and (copen == "<!--") and (cstart == "Using lwarp")) then
+ -- verified the use of \usepackage{lwarp}
+ usinglwarp = true ;
+else
-- not a splitpoint
io.write (line .. "\n") ;
-end
+end end
end -- do
io.close(sfile)
+if ( usinglwarp == false ) then
+ print ("lwarpmk: ===")
+ print ("lwarpmk: \\usepackage{lwarp} was not detected.")
+ print ("lwarpmk: The HTML output will not be correct.")
+ print ("lwarpmk: Ensured that \\usepackage{lwarp} is enabled,")
+ print ("lwarpmk: then lwarpmk print and lwarpmk HTML again.")
+ print ("lwarpmk: ===")
+end
end -- function
function cvalueerror ( line, linenum , cvalue )
@@ -7993,6 +8023,13 @@ end -- not --version
\LWR@origpagenumbering{arabic}
\LWR@traceinfo{LWR@lwarpStart: Starting new file.}
\LWR@filestart
+\begingroup%
+\LWR@nullfonts%
+\LWR@htmlblockcomment{%
+|Using lwarp|%
+\LWR@htmlsectionfilename{\LWR@thisfilename}|%
+}
+\endgroup%
\LWR@traceinfo{LWR@lwarpStart: Generating first header.}
\ifdefempty{\LWR@firstpagetop}{}{%
\LWR@htmltag{header}\LWR@orignewline