diff options
author | Karl Berry <karl@freefriends.org> | 2017-10-30 20:40:38 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-10-30 20:40:38 +0000 |
commit | 50d0760490f7e9df364939f4305c19197d49d17a (patch) | |
tree | 3c687c339bf6991aa897b5eac4a7a9b1f75bdccd /Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty | |
parent | d1742894869da9494417216646bc5627ef3f3352 (diff) |
lwarp (30oct17)
git-svn-id: svn://tug.org/texlive/trunk@45648 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lwarp/lwarp-graphics.sty | 60 |
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'. |