summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty')
-rw-r--r--Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty60
1 files changed, 57 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty
index ac05d9f80b5..8895747c1c2 100644
--- a/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty
+++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty
@@ -114,6 +114,7 @@
\define@key{igraph}{read}{}
\define@key{igraph}{command}{}
+
\newcommand*{\LWR@rotstyle}[2]{%
#1transform:rotate(-#2deg);
}
@@ -128,6 +129,14 @@
\def\LWR@opacity{1}
+\newsavebox{\LWR@imagesizebox}
+
+\let\LWR@origGin@setfile\Gin@setfile
+
+\AtBeginDocument{
+\define@key{Gin}{class}{}
+}
+
\NewDocumentCommand{\LWR@includegraphicsb}{s o o m}
{%
\LWR@traceinfo{LWR@includegraphicsb #4}%
@@ -142,11 +151,13 @@
\setlength{\textheight}{9in}%
}%
}{}%
+\begingroup%
\renewcommand*{\Gin@setfile}[3]{%
\LWR@traceinfo{Gin@setfile ##3}%
\xdef\LWR@parsedfilename{##3}%
}%
-\Ginclude@graphics{\detokenize{#4}}%
+\Ginclude@graphics{\detokenize\expandafter{#4}}%
+\endgroup%
\filename@parse{\LWR@parsedfilename}%
\large%
\setlength{\LWR@igwidth}{0pt}%
@@ -163,6 +174,46 @@
{\setkeys{igraph}{#2}}%
{\setkeys{igraph}{}}%
}%
+\ifbool{FormatWP}{%
+ \begingroup%
+ \DeclareGraphicsExtensions{.pdf,.PDF,.gif,.GIF,.png,.PNG,.jpg,.JPG,.jpeg,.JPEG}%
+ \define@key{Gin}{angle}{}%
+ \IfBooleanTF{#1}%
+ {% starred
+ \IfValueTF{#3}%
+ {%
+ \global\sbox{\LWR@imagesizebox}{\LWR@origincludegraphics*[#2][#3]{#4}}%
+ }%
+ {%
+ \IfValueTF{#2}%
+ {%
+ \global\sbox{\LWR@imagesizebox}{\LWR@origincludegraphics*[#2]{#4}}%
+ }{%
+ \global\sbox{\LWR@imagesizebox}{\LWR@origincludegraphics*{#4}}%
+ }%
+ }%
+ }% starred
+ {% not starred
+ \IfValueTF{#3}%
+ {%
+ \global\sbox{\LWR@imagesizebox}{\LWR@origincludegraphics[#2][#3]{#4}}%
+ }%
+ {%
+ \IfValueTF{#2}%
+ {%
+ \global\sbox{\LWR@imagesizebox}{\LWR@origincludegraphics[#2]{#4}}%
+ }{%
+ \global\sbox{\LWR@imagesizebox}{\LWR@origincludegraphics{#4}}%
+ }%
+ }%
+ }% not starred
+ \endgroup%
+ \uselengthunit{PT}%
+ \settowidth{\LWR@igwidth}{\usebox{\LWR@imagesizebox}}%
+ \global\renewcommand*{\LWR@igwidthstyle}{width:\rndprintlength{\LWR@igwidth}}%
+ \settoheight{\LWR@igheight}{\usebox{\LWR@imagesizebox}}%
+ \global\renewcommand*{\LWR@igheightstyle}{height:\rndprintlength{\LWR@igheight}}%
+}{}%
\LWR@traceinfo{LWR@includegraphicsb: about to create href}%
\href{\LWR@parsedfilename}%
{% start of href
@@ -212,9 +263,12 @@ img src="\LWR@parsedfilename" \LWR@orignewline%
+\AtBeginDocument{
+
+\LWR@traceinfo{Patching includegraphics.}
+
\LetLtxMacro\LWR@origincludegraphics\includegraphics
-\AtBeginDocument{
\renewcommand*{\includegraphics}
{%
\LWR@traceinfo{includegraphics}
@@ -225,6 +279,7 @@ img src="\LWR@parsedfilename" \LWR@orignewline%
}% includegraphics
}% AtBeginDocument
+
\newcommand*{\LWR@rotboxorigin}{}
\newcommand*{\LWR@originname}[1]{%
\ifthenelse{\equal{#1}{t}}{top}{}%
@@ -292,7 +347,6 @@ img src="\LWR@parsedfilename" \LWR@orignewline%
\AtBeginDocument{
\renewcommand{\resizebox}[3]{#3}
}
-
\endinput
%%
%% End of file `lwarp-graphics.sty'.