summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/combinedgraphics
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2011-08-02 19:45:13 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2011-08-02 19:45:13 +0000
commit385daa279ac68fc0277e25586e8745366abfb796 (patch)
tree11f8483935e9f10b32f766498a180510c1ff647e /Master/texmf-dist/tex/latex/combinedgraphics
parentca8a3b699546b5989ac38dc20c506fd09506da0c (diff)
combinedgrphics update
git-svn-id: svn://tug.org/texlive/trunk@23356 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/combinedgraphics')
-rw-r--r--Master/texmf-dist/tex/latex/combinedgraphics/combinedgraphics.sty43
1 files changed, 39 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/latex/combinedgraphics/combinedgraphics.sty b/Master/texmf-dist/tex/latex/combinedgraphics/combinedgraphics.sty
index 94f20040bca..ae2ec9a83b5 100644
--- a/Master/texmf-dist/tex/latex/combinedgraphics/combinedgraphics.sty
+++ b/Master/texmf-dist/tex/latex/combinedgraphics/combinedgraphics.sty
@@ -35,16 +35,18 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{combinedgraphics}
- [2009/11/01 v0.0.2-alpha inclusion of combined EPS/LaTeX graphics]
+ [2011/06/15 v0.1.1-alpha inclusion of combined EPS/LaTeX graphics]
\RequirePackage{keyval}
\RequirePackage{graphicx}
\RequirePackage{color}
+\newif\ifcgr@vecfirst
\newcommand*\cgr@defopts{\define@key{cgr}}
\newcommand*\cgr@setopts{\setkeys{cgr}}
\cgr@defopts{textfontcmd}{\gdef\cgr@textfont@default{\@nameuse{#1}}}
\cgr@defopts{textcolorcmd}{\gdef\cgr@textcolor@default{\@nameuse{#1}}}
\cgr@defopts{vecscale}{\gdef\cgr@vecscale@default{#1}}
\cgr@defopts{vecinclude}{\gdef\cgr@vecinclude@default{#1}}
+\cgr@defopts{vecfirst}{\gdef\cgr@vecfirst@default{#1}}
\DeclareOption*{%
\expandafter\cgr@setopts\expandafter{\CurrentOption}%
}
@@ -82,6 +84,9 @@
\cgr@defopts@combgrphcs{vecinclude}{%
\def\cgr@vecinclude{\@nameuse{cgr@requires@graphics#1}}%
}
+\cgr@defopts@combgrphcs{vecfirst}{%
+ \@nameuse{cgr@vecfirst#1}%
+}
\cgr@defopts@combgrphcs{vecfile}{%
\def\cgr@vecfile{#1}%
\cgr@setopts@combgrphcs{vecinclude=overwrite}%
@@ -207,6 +212,7 @@
\def\cgr@textcolor{}
\def\cgr@vecscale{1}
\def\cgr@vecinclude{\cgr@requires@graphicsauto}
+\cgr@vecfirsttrue
\def\cgr@vecfile{}
\def\cgr@curr@hscale{}
\def\cgr@curr@vscale{}
@@ -224,12 +230,24 @@
\input{#2}%
}%
\cgr@addto@macro{\cgr@curr@pic}{%
+ %% from basic macro options
\cgr@vecinclude\cgr@textfont\cgr@textcolor%
+ %% inclusion of vector graphics part
\ifcgr@requires@graphics%
- \begin{picture}(0,0)%
- \cgr@includegraphics@orig[scale=\cgr@vecscale]{\cgr@vecfile}%
- \end{picture}%
+ \ifcgr@vecfirst%
+ \begin{picture}(0,0)%
+ \cgr@includegraphics@orig[scale=\cgr@vecscale]{\cgr@vecfile}%
+ \end{picture}%
+ \else%
+ \def\picture{\cgr@picture}%
+ \def\endpicture{%
+ \put(\cgr@picture@xoffs,\cgr@picture@yoffs)%
+ {\cgr@includegraphics@orig[scale=\cgr@vecscale]{\cgr@vecfile}}%
+ \cgr@endpicture@orig%
+ }%
+ \fi%
\fi%
+ %% inclusion of \LaTeX{} part
\input{#2}%
}%
\@ifundefined{cgr@vecscale@default}{}{%
@@ -244,6 +262,9 @@
\@ifundefined{cgr@vecinclude@default}{}{%
\cgr@setopts@combgrphcs{vecinclude=\cgr@vecinclude@default}%
}%
+ \@ifundefined{cgr@vecfirst@default}{}{%
+ \cgr@setopts@combgrphcs{vecfirst=\cgr@vecfirst@default}%
+ }%
\def\cgr@vecfile{#2}%
\cgr@setopts@combgrphcs{#1}%
\cgr@curr@pic%
@@ -305,6 +326,20 @@
\def\cgr@includegraphics@s@@@[#1][#2]{%
\cgr@includegraphics@orig*[#1][#2,scale=\cgr@vecscale]%
}
+\let\cgr@picture@orig=\picture
+\let\cgr@endpicture@orig=\endpicture
+\long\def\cgr@picture(#1,#2){%
+ \@ifnextchar({%
+ \cgr@picture@(#1,#2)%
+ }{%
+ \cgr@picture@(#1,#2)(0,0)%
+ }%
+}
+\def\cgr@picture@(#1,#2)(#3,#4){%
+ \def\cgr@picture@xoffs{#3}%
+ \def\cgr@picture@yoffs{#4}%
+ \cgr@picture@orig(#1,#2)(#3,#4)%
+}
\newcommand{\cgr@addto@macro}[2]{%
\begingroup\toks@\expandafter{#1#2}%
\edef\@tempa{\endgroup\def\noexpand#1{\the\toks@}}%