diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty | 276 |
1 files changed, 275 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty index 9d3dfbc167e..ac05d9f80b5 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty @@ -17,7 +17,281 @@ %% version 2005/12/01 or later. -\LWR@ProvidesPackageDrop{graphics} +\LWR@ProvidesPackagePass{graphics} + + +\AtBeginDocument{ +\DeclareGraphicsExtensions{.svg,.SVG,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG} +\DeclareGraphicsRule{.svg}{svg}{.svg}{} +\DeclareGraphicsRule{.SVG}{svg}{.SVG}{} +} +\appto\LWR@restoreorigformatting{% +\DeclareGraphicsExtensions{.pdf,.PDF,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG}% +} + + +\AtBeginDocument{ +\renewcommand*{\unitspace}{} +} + +\newlength{\LWR@igwidth} +\newlength{\LWR@igheight} +\newcommand*{\LWR@igwidthstyle}{} +\newcommand*{\LWR@igheightstyle}{} +\newcommand*{\LWR@igorigin}{} +\newcommand*{\LWR@igangle}{} +\newcommand*{\LWR@igxscale}{1} +\newcommand*{\LWR@igyscale}{1} +\newcommand*{\LWR@igclass}{inlineimage} + +\define@key{igraph}{width}{% +\setlength{\LWR@igwidth}{#1}% +\ifthenelse{\lengthtest{\LWR@igwidth > 0pt}}% +{% + \uselengthunit{PT}% + \renewcommand*{\LWR@igwidthstyle}{width:\rndprintlength{\LWR@igwidth}}% + \IfEndWith{#1}{ex}% + {\renewcommand*{\LWR@igwidthstyle}{width:#1}}% yes ex + {}% not ex + \IfEndWith{#1}{em}% + {\renewcommand*{\LWR@igwidthstyle}{width:#1}}% yes em + {}% not em + \IfEndWith{#1}{\%}% + {\renewcommand*{\LWR@igwidthstyle}{width:#1}}% yes percent + {}% not percent + \IfEndWith{#1}{px}% + {\renewcommand*{\LWR@igwidthstyle}{width:#1}}% yes px + {}% not px +}{}% end of length > 0pt +} +\define@key{igraph}{height}{% +\setlength{\LWR@igheight}{#1}% +\ifthenelse{\lengthtest{\LWR@igheight > 0pt}}% +{% + \uselengthunit{PT}% + \renewcommand*{\LWR@igheightstyle}{% + height:\rndprintlength{\LWR@igheight} % + }% + \IfEndWith{#1}{ex}% + {\renewcommand*{\LWR@igheightstyle}{height:#1}}% yes ex + {}% not ex + \IfEndWith{#1}{em}% + {\renewcommand*{\LWR@igheightstyle}{height:#1}}% yes em + {}% not em + \IfEndWith{#1}{\%}% + {\renewcommand*{\LWR@igheightstyle}{height:#1}}% yes percent + {}% not percent + \IfEndWith{#1}{px}% + {\renewcommand*{\LWR@igheightstyle}{height:#1}}% yes px + {}% not px +}{}% end of length > 0pt +} +\define@key{igraph}{origin}{% +\renewcommand*{\LWR@igorigin}{#1}% +} +\define@key{igraph}{angle}{\renewcommand*{\LWR@igangle}{#1}} +\define@key{igraph}{class}{\renewcommand*{\LWR@igclass}{#1}} + +\define@key{igraph}{scale}{% +\renewcommand*{\LWR@igxscale}{#1}% +\renewcommand*{\LWR@igyscale}{#1}} +\define@key{igraph}{bb}{} +\define@key{igraph}{bbllx}{} +\define@key{igraph}{bblly}{} +\define@key{igraph}{bburx}{} +\define@key{igraph}{bbury}{} +\define@key{igraph}{natwidth}{} +\define@key{igraph}{natheight}{} +\define@key{igraph}{hiresbb}{} +\define@key{igraph}{viewport}{} +\define@key{igraph}{trim}{} +\define@key{igraph}{totalheight}{} +\define@key{igraph}{keepaspectratio}{} +\define@key{igraph}{clip}{} +\define@key{igraph}{draft}{} +\define@key{igraph}{type}{} +\define@key{igraph}{ext}{} +\define@key{igraph}{read}{} +\define@key{igraph}{command}{} + +\newcommand*{\LWR@rotstyle}[2]{% + #1transform:rotate(-#2deg); +} + +\newcommand*{\LWR@scalestyle}[3]{% + #1transform:scale(#2,#3); +} + + +\newbool{LWR@infloatrow} +\boolfalse{LWR@infloatrow} + +\def\LWR@opacity{1} + +\NewDocumentCommand{\LWR@includegraphicsb}{s o o m} +{% +\LWR@traceinfo{LWR@includegraphicsb #4}% +\LWR@origtilde \LWR@orignewline% +\ifthenelse{\cnttest{\value{LWR@minipagedepth}}{=}{0}}% +{% + \ifbool{LWR@infloatrow}% + {} + {% not in a minipage or a floatrow: + \setlength{\linewidth}{6in}% + \setlength{\textwidth}{6in}% + \setlength{\textheight}{9in}% + }% +}{}% +\renewcommand*{\Gin@setfile}[3]{% +\LWR@traceinfo{Gin@setfile ##3}% +\xdef\LWR@parsedfilename{##3}% +}% +\Ginclude@graphics{\detokenize{#4}}% +\filename@parse{\LWR@parsedfilename}% +\large% +\setlength{\LWR@igwidth}{0pt}% +\setlength{\LWR@igheight}{0pt}% +\renewcommand*{\LWR@igwidthstyle}{}% +\renewcommand*{\LWR@igheightstyle}{}% +\renewcommand*{\LWR@igorigin}{}% +\renewcommand*{\LWR@igangle}{}% +\renewcommand*{\LWR@igxscale}{1}% +\renewcommand*{\LWR@igyscale}{1}% +\renewcommand*{\LWR@igclass}{inlineimage}% +\IfValueF{#3}{% +\IfValueTF{#2}% +{\setkeys{igraph}{#2}}% +{\setkeys{igraph}{}}% +}% +\LWR@traceinfo{LWR@includegraphicsb: about to create href}% +\href{\LWR@parsedfilename}% +{% start of href +\LWR@traceinfo{LWR@includegraphicsb: about to LWR@htmltag}% +\LWR@htmltag{% start of image tags +img src="\LWR@parsedfilename" \LWR@orignewline% +\LWR@origtilde{} alt="[\filename@base]" \LWR@orignewline% +\ifthenelse{ + \NOT\equal{\LWR@igwidthstyle}{} \OR + \NOT\equal{\LWR@igheightstyle}{} \OR + \NOT\equal{\LWR@igorigin}{} \OR + \NOT\equal{\LWR@igangle}{} \OR + \NOT\equal{\LWR@igxscale}{1} \OR + \NOT\equal{\LWR@igyscale}{1} +}% +{\LWR@origtilde{} style="% +\ifthenelse{\NOT\equal{\LWR@igwidthstyle}{}}% +{\LWR@igwidthstyle;}{}% +\ifthenelse{\NOT\equal{\LWR@igheightstyle}{}}% +{\LWR@igheightstyle;}{}% +\ifthenelse{\NOT\equal{\LWR@igorigin}{}}% +{\LWR@origtilde{} transform-origin: \LWR@originnames{\LWR@igorigin}; \LWR@orignewline}{}% +\ifthenelse{\NOT\equal{\LWR@igangle}{}}% +{% +\LWR@rotstyle{-ms-}{\LWR@igangle}% +\LWR@rotstyle{-webkit-}{\LWR@igangle}% +\LWR@rotstyle{}{\LWR@igangle% +}}{}% +\ifthenelse{\NOT\equal{\LWR@igxscale}{1}\OR% +\NOT\equal{\LWR@igyscale}{1}}% +{\LWR@scalestyle{-ms-}{\LWR@igxscale}{\LWR@igyscale}% +\LWR@scalestyle{-webkit-}{\LWR@igxscale}{\LWR@igyscale}% +\LWR@scalestyle{}{\LWR@igxscale}{\LWR@igyscale}}{}% +\ifthenelse{\NOT\equal{\LWR@opacity}{1}}% +{opacity:\LWR@opacity;}% +{}% +" \LWR@orignewline}{}% +\LWR@origtilde{} class="\LWR@igclass" \LWR@orignewline% +}% end of image tags +}% end of href +\endgroup +\LWR@origscriptsize +\LWR@traceinfo{LWR@includegraphicsb done}% +} + + + + + +\LetLtxMacro\LWR@origincludegraphics\includegraphics + +\AtBeginDocument{ +\renewcommand*{\includegraphics} +{% +\LWR@traceinfo{includegraphics} +\LWR@ensuredoingapar% +\begingroup% +\catcode`\_=12% +\LWR@includegraphicsb% +}% includegraphics +}% AtBeginDocument + +\newcommand*{\LWR@rotboxorigin}{} +\newcommand*{\LWR@originname}[1]{% +\ifthenelse{\equal{#1}{t}}{top}{}% +\ifthenelse{\equal{#1}{b}}{bottom}{}% +\ifthenelse{\equal{#1}{c}}{center}{}% +\ifthenelse{\equal{#1}{l}}{left}{}% +\ifthenelse{\equal{#1}{r}}{right}{}% +} +\newcommand*{\LWR@originnames}[1]{% +\StrChar{#1}{1}[\LWR@strresult]% +\LWR@originname{\LWR@strresult} +\StrChar{#1}{2}[\LWR@strresult]% +\LWR@originname{\LWR@strresult} +} +\define@key{krotbox}{origin}{% +\renewcommand*{\LWR@rotboxorigin}{#1}% +} +\define@key{krotbox}{x}{} +\define@key{krotbox}{y}{} +\define@key{krotbox}{units}{} +\LetLtxMacro\LWR@origrotatebox\rotatebox + +\AtBeginDocument{ +\RenewDocumentCommand{\rotatebox}{O{} m +m}{% +\renewcommand*{\LWR@rotboxorigin}{} +\setkeys{krotbox}{#1}% +\LWR@htmltagc{span style="display: inline-block; % +\ifthenelse{\NOT\equal{\LWR@rotboxorigin}{}}% +{transform-origin: \LWR@originnames{\LWR@rotboxorigin};\LWR@origtilde}{}% +\LWR@rotstyle{-ms-}{#2} % +\LWR@rotstyle{-webkit-}{#2} % +\LWR@rotstyle{}{#2} % +"{}}\LWR@orignewline% +\begin{LWR@nestspan}% +#3% +\LWR@htmltagc{/span}% +\end{LWR@nestspan}% +} +}% AtBeginDocument + +\LetLtxMacro\LWR@origscalebox\scalebox + +\AtBeginDocument{ +\RenewDocumentCommand{\scalebox}{m o m}{% +\LWR@htmltagc{span style="display: inline-block; % +\LWR@scalestyle{-ms-}{#1}{\IfNoValueTF{#2}{#1}{#2}} % +\LWR@scalestyle{-webkit-}{#1}{\IfNoValueTF{#2}{#1}{#2}} % +\LWR@scalestyle{}{#1}{\IfNoValueTF{#2}{#1}{#2}} % +"{}}% +\begin{LWR@nestspan}% +#3% +\LWR@htmltagc{/span}% +\end{LWR@nestspan}% +} +}% AtBeginDocument + +\let\LWR@origreflectbox\reflectbox + +\AtBeginDocument{ +\renewcommand{\reflectbox}[1]{\scalebox{-1}[1]{#1}} +} + +\LetLtxMacro\LWR@origresizebox\resizebox + +\AtBeginDocument{ +\renewcommand{\resizebox}[3]{#3} +} \endinput %% |