diff options
12 files changed, 324 insertions, 45 deletions
diff --git a/Master/texmf-dist/source/latex/combinedgraphics/Makefile b/Master/texmf-dist/doc/latex/combinedgraphics/Makefile index ae99f280867..4c2c3299887 100644 --- a/Master/texmf-dist/source/latex/combinedgraphics/Makefile +++ b/Master/texmf-dist/doc/latex/combinedgraphics/Makefile @@ -1,7 +1,7 @@ # # Makefile for combinedgraphics package # -# Copyright 2009 Christian Schneider <software(at)chschneider(dot)eu> +# Copyright 2009,2011 Christian Schneider <software(at)chschneider(dot)eu> # # This file is part of combinedgraphics. # @@ -20,12 +20,18 @@ # WARNING: THIS IS ALPHA SOFTWARE AND MAY CONTAIN SERIOUS BUGS! # -PACKAGE := combinedgraphics +export PACKAGE := combinedgraphics PDFLATEX := pdflatex MAKEINDEX := makeindex -.PHONY: all pkg doc test clean distclean force +# installation directories +DESTDIR := $(HOME)/.texmf +DOCDIR := $(DESTDIR)/doc/latex/$(PACKAGE) +SRCDIR := $(DESTDIR)/source/latex/$(PACKAGE) +TEXDIR := $(DESTDIR)/tex/latex/$(PACKAGE) + +.PHONY: all pkg doc test install clean distclean force all: pkg doc test @@ -49,10 +55,18 @@ $(PACKAGE).pdf: %.pdf: %.dtx %.sty %.ind %.gls pkg: $(PACKAGE).sty +doc: $(PACKAGE).pdf + test: $(PACKAGE).sty force $(MAKE) -C test -doc: $(PACKAGE).pdf +install: force + mkdir -p $(DOCDIR) $(SRCDIR) $(TEXDIR) + install -m 644 README COPYING $(PACKAGE).pdf $(DOCDIR) + install -m 644 $(PACKAGE).ins $(PACKAGE).dtx Makefile $(SRCDIR) + install -m 644 $(PACKAGE).sty $(TEXDIR) + $(MAKE) -C test install + mktexlsr $(DESTDIR) clean: force $(RM) *.aux *.glo *.gls *.idx *.ilg *.ind *.log *.toc *~ diff --git a/Master/texmf-dist/doc/latex/combinedgraphics/README b/Master/texmf-dist/doc/latex/combinedgraphics/README index 58aa5f82a00..c2696be5d78 100644 --- a/Master/texmf-dist/doc/latex/combinedgraphics/README +++ b/Master/texmf-dist/doc/latex/combinedgraphics/README @@ -7,15 +7,19 @@ This package provides a macro (|\includecombinedgraphics|) for the inclusion of combined EPS/\LaTeX{} and PDF/\LaTeX{} graphics (an export format of Gnuplot, Xfig, and maybe other programs). Instead of including the graphics with a simple |\input|, the |\includecombinedgraphics| macro -has some comforts: +has some benefits: \begin{itemize} - \item changing the font and color of the text of the \LaTeX{} part + \item changing the font and color of the text of the \LaTeX{} parts \item rescaling the graphics without affecting the font of the \LaTeX{} - part - \item automatic inclusion of the vector graphics part, as far as \LaTeX{} - part does not do it (e.\,g., for files exported from Gnuplot before - version 4.2) + parts + \item automatic inclusion of the vector graphics parts, as far as \LaTeX{} + parts do not do it (e.\,g., for files exported from Gnuplot before + version 4.2 or Xfig) + \item changing the inclusion order of \LaTeX{} and vector graphics + parts (e.\,g., Gnuplot 4.4 exports files in a way that the vector + graphics part overlays the \LaTeX{} part, which means that text may be + hidden under shaded areas) \item rescaling and rotating of complete graphics (similar to |\includegraphics| from \textsf{graphicx} package) \end{itemize} @@ -66,12 +70,30 @@ Optionally you can compile the test file: INSTALLATION ============ -Copy the file `combinedgraphics.sty' to a directory, where LaTeX will find it. +INSTALLATION +============ + +1) Installing with make +----------------------- + +To install the package into a TDS (= TeX directory structure; typically its base +directory is named `texmf' or something similar), run the following command: + $ make DESTDIR=<your TDS> install + +Note: `$(DESTDIR)' defaults to `$(HOME)/.texmf'. + +2) Installing manually +---------------------- + +In principle, you will only habe to copy the file `ionumbers.sty' into a +directory, where LaTeX can find it. If you copy it into a TDS (TeX directory +structure), you will most probably have to run the following command afterwards: + $ mktexlsr <your TDS> LICENSE ======= -Copyright 2009 Christian Schneider <software(at)chschneider(dot)eu> +Copyright 2009,2011 Christian Schneider <software(at)chschneider(dot)eu> ion@addto@macro: identical to l@addto@macro from koma-script bundle v2.9t diff --git a/Master/texmf-dist/doc/latex/combinedgraphics/combinedgraphics.pdf b/Master/texmf-dist/doc/latex/combinedgraphics/combinedgraphics.pdf Binary files differindex 7fe0df80404..4820d52c6f4 100644 --- a/Master/texmf-dist/doc/latex/combinedgraphics/combinedgraphics.pdf +++ b/Master/texmf-dist/doc/latex/combinedgraphics/combinedgraphics.pdf diff --git a/Master/texmf-dist/doc/latex/combinedgraphics/test/Makefile b/Master/texmf-dist/doc/latex/combinedgraphics/test/Makefile index 99bffe2c6ea..7be7e0b5207 100644 --- a/Master/texmf-dist/doc/latex/combinedgraphics/test/Makefile +++ b/Master/texmf-dist/doc/latex/combinedgraphics/test/Makefile @@ -1,7 +1,7 @@ # # Makefile for tests of combinedgraphics package # -# Copyright 2009 Christian Schneider <software(at)chschneider(dot)eu> +# Copyright 2009,2011 Christian Schneider <software(at)chschneider(dot)eu> # # This file is part of combinedgraphics. # @@ -26,6 +26,11 @@ STYFILES := ../combinedgraphics.sty FIGFILES := xfig325.fig PLTFILES := gnuplot42.plt +# installation directories +DESTDIR := $(HOME)/.texmf +DOCDIR := $(DESTDIR)/doc/latex/$(PACKAGE)/test +SRCDIR := $(DESTDIR)/source/latex/$(PACKAGE)/test + # output files PDFFILE := $(patsubst %.tex,%.pdf,$(SRCFILE)) TEXGRAPHICS := $(patsubst %.fig,%.tex,$(FIGFILES)) \ @@ -45,7 +50,7 @@ EPSTOPDF := epstopdf export TEXINPUTS := .:..:$(TEXINPUTS) export TEXPICTS := .:..:$(TEXPICTS) -.PHONY: all test clean distclean +.PHONY: all test install clean distclean force all: test @@ -66,10 +71,19 @@ $(PDFFILE): %.pdf: %.tex $(STYFILES) $(TEXGRAPHICS) $(PDFGRAPHICS) $(PDFLATEX) -interaction=nonstopmode $< $(PDFLATEX) -interaction=nonstopmode $< -test: $(PDFFILE) +test: $(PDFFILE) $(EPSGRAPHICS) + +install: force + mkdir -p $(DOCDIR) $(SRCDIR) + install -m 644 $(TEXGRAPHICS) $(EPSGRAPHICS) $(PDFGRAPHICS) \ + $(PDFFILE) $(DOCDIR) + install -m 644 $(SRCFILE) $(FIGFILES) $(PLTFILES) Makefile $(SRCDIR) -clean: +clean: force $(RM) *.aux *.glo *.gls *.idx *.ilg *.ind *.log *.toc *~ -distclean: clean +distclean: clean force $(RM) $(PDFFILE) $(TEXGRAPHICS) $(EPSGRAPHICS) $(PDFGRAPHICS) + +force: ; + diff --git a/Master/texmf-dist/doc/latex/combinedgraphics/test/combinedgraphics_test.pdf b/Master/texmf-dist/doc/latex/combinedgraphics/test/combinedgraphics_test.pdf Binary files differindex 824438ce63b..8426d86e8b3 100644 --- a/Master/texmf-dist/doc/latex/combinedgraphics/test/combinedgraphics_test.pdf +++ b/Master/texmf-dist/doc/latex/combinedgraphics/test/combinedgraphics_test.pdf diff --git a/Master/texmf-dist/doc/latex/combinedgraphics/test/combinedgraphics_test.tex b/Master/texmf-dist/doc/latex/combinedgraphics/test/combinedgraphics_test.tex index 4b904148c36..76cc1e220ab 100644 --- a/Master/texmf-dist/doc/latex/combinedgraphics/test/combinedgraphics_test.tex +++ b/Master/texmf-dist/doc/latex/combinedgraphics/test/combinedgraphics_test.tex @@ -1,7 +1,7 @@ % % LaTeX test file for combinedgraphics package % -% Copyright 2009 Christian Schneider <software(at)chschneider(dot)eu> +% Copyright 2009,2011 Christian Schneider <software(at)chschneider(dot)eu> % % This file is part of combinedgraphics. % @@ -117,4 +117,11 @@ \fbox{\input{gnuplot42}}\\ \fbox{\includecombinedgraphics[angle=30,scale=0.75,angle=15]{xfig325}}% \fbox{\includecombinedgraphics[angle=30,scale=0.75,angle=15]{gnuplot42}} + + \section*{Test: \texttt{vecfirst=false,vecinclude=overwrite}} + \noindent + \fbox{\combinput{xfig325}}% + \fbox{\input{gnuplot42}}\\ + \fbox{\includecombinedgraphics[vecfirst=false,vecinclude=overwrite]{xfig325}}% + \fbox{\includecombinedgraphics[vecfirst=false,vecinclude=overwrite]{gnuplot42}} \end{document} diff --git a/Master/texmf-dist/doc/latex/combinedgraphics/test/gnuplot42.eps b/Master/texmf-dist/doc/latex/combinedgraphics/test/gnuplot42.eps index 22f76ffca32..aac026a067f 100644 --- a/Master/texmf-dist/doc/latex/combinedgraphics/test/gnuplot42.eps +++ b/Master/texmf-dist/doc/latex/combinedgraphics/test/gnuplot42.eps @@ -1,7 +1,7 @@ %!PS-Adobe-2.0 EPSF-2.0 %%Title: gnuplot42.tex %%Creator: gnuplot 4.2 patchlevel 2 -%%CreationDate: Sun Nov 1 21:23:59 2009 +%%CreationDate: Wed Jun 15 00:40:51 2011 %%DocumentFonts: %%BoundingBox: 50 50 230 176 %%EndComments @@ -48,7 +48,7 @@ SDict begin [ /Author (,,,) % /Producer (gnuplot) % /Keywords () - /CreationDate (Sun Nov 1 21:23:59 2009) + /CreationDate (Wed Jun 15 00:40:51 2011) /DOCINFO pdfmark end } ifelse diff --git a/Master/texmf-dist/doc/latex/combinedgraphics/test/gnuplot42.pdf b/Master/texmf-dist/doc/latex/combinedgraphics/test/gnuplot42.pdf index 33f4aaadcdb..b540d53b35c 100644 --- a/Master/texmf-dist/doc/latex/combinedgraphics/test/gnuplot42.pdf +++ b/Master/texmf-dist/doc/latex/combinedgraphics/test/gnuplot42.pdf @@ -44,10 +44,10 @@ endobj <?adobe-xap-filters esc="CRLF"?> <x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'> <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'> -<rdf:Description rdf:about='09b8c1be-ff41-11e9-0000-93131edb0da5' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.62'/> -<rdf:Description rdf:about='09b8c1be-ff41-11e9-0000-93131edb0da5' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='Sun -No-v T 1: 2:1:23::9 ' xap:CreateDate='Sun -No-v T 1: 2:1:23::9 '><xap:CreatorTool>gnuplot 4.2 patchlevel 2 </xap:CreatorTool></rdf:Description> -<rdf:Description rdf:about='09b8c1be-ff41-11e9-0000-93131edb0da5' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='09b8c1be-ff41-11e9-0000-93131edb0da5'/> -<rdf:Description rdf:about='09b8c1be-ff41-11e9-0000-93131edb0da5' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>gnuplot42.tex</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>,,,</rdf:li></rdf:Seq></dc:creator></rdf:Description> +<rdf:Description rdf:about='e79c34d0-cef3-11eb-0000-93131edb0da5' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.62'/> +<rdf:Description rdf:about='e79c34d0-cef3-11eb-0000-93131edb0da5' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='Wed -Ju-n T15: 0:0:40::1 ' xap:CreateDate='Wed -Ju-n T15: 0:0:40::1 '><xap:CreatorTool>gnuplot 4.2 patchlevel 2 </xap:CreatorTool></rdf:Description> +<rdf:Description rdf:about='e79c34d0-cef3-11eb-0000-93131edb0da5' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='e79c34d0-cef3-11eb-0000-93131edb0da5'/> +<rdf:Description rdf:about='e79c34d0-cef3-11eb-0000-93131edb0da5' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>gnuplot42.tex</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>,,,</rdf:li></rdf:Seq></dc:creator></rdf:Description> </rdf:RDF> </x:xmpmeta> @@ -57,8 +57,8 @@ endstream endobj 2 0 obj <</Producer(GPL Ghostscript 8.62) -/CreationDate(Sun Nov 1 21:23:59 2009) -/ModDate(D:20091101212400+01'00') +/CreationDate(Wed Jun 15 00:40:51 2011) +/ModDate(D:20110615004051+02'00') /Title(gnuplot42.tex) /Subject(gnuplot plot) /Creator(gnuplot 4.2 patchlevel 2 ) @@ -77,7 +77,7 @@ xref 0000001217 00000 n trailer << /Size 10 /Root 1 0 R /Info 2 0 R -/ID [<724334C0C5E93F78CBF3F712CAD83E5B><724334C0C5E93F78CBF3F712CAD83E5B>] +/ID [<403CF5A2B2BEA41D990A665B14EBAC45><403CF5A2B2BEA41D990A665B14EBAC45>] >> startxref 2874 diff --git a/Master/texmf-dist/doc/latex/combinedgraphics/test/xfig325.eps b/Master/texmf-dist/doc/latex/combinedgraphics/test/xfig325.eps new file mode 100644 index 00000000000..7a18fa94253 --- /dev/null +++ b/Master/texmf-dist/doc/latex/combinedgraphics/test/xfig325.eps @@ -0,0 +1,114 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: xfig325.fig +%%Creator: fig2dev Version 3.2 Patchlevel 5 +%%CreationDate: Wed Jun 15 00:40:51 2011 +%%For: chsch@europa (,,,) +%%BoundingBox: 0 0 87 87 +%Magnification: 1.0000 +%%EndComments +%%BeginProlog +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def + +/pageheader { +save +newpath 0 87 moveto 0 0 lineto 87 0 lineto 87 87 lineto closepath clip newpath +0.8 85.8 translate +1 -1 scale +$F2psBegin +10 setmiterlimit +0 slj 0 slc + 0.06299 0.06299 sc +} bind def +/pagefooter { +$F2psEnd +restore +} bind def +%%EndProlog +pageheader +% +% Fig objects follow +% +% +% here starts figure with depth 50 +% Polyline +0 slj +0 slc +7.500 slw +n 0 0 m 1350 0 l 1350 1350 l 0 1350 l + cp gs col6 1.00 shd ef gr gs col0 s gr +% here ends figure; +pagefooter +showpage +%%Trailer +%EOF diff --git a/Master/texmf-dist/doc/latex/combinedgraphics/test/xfig325.pdf b/Master/texmf-dist/doc/latex/combinedgraphics/test/xfig325.pdf Binary files differindex 430057751e5..93d74696642 100644 --- a/Master/texmf-dist/doc/latex/combinedgraphics/test/xfig325.pdf +++ b/Master/texmf-dist/doc/latex/combinedgraphics/test/xfig325.pdf diff --git a/Master/texmf-dist/source/latex/combinedgraphics/combinedgraphics.dtx b/Master/texmf-dist/source/latex/combinedgraphics/combinedgraphics.dtx index fa02298f216..436925c88fa 100644 --- a/Master/texmf-dist/source/latex/combinedgraphics/combinedgraphics.dtx +++ b/Master/texmf-dist/source/latex/combinedgraphics/combinedgraphics.dtx @@ -3,7 +3,7 @@ % % DocStrip file for combinedgraphics package % -% Copyright 2009 Christian Schneider <software(at)chschneider(dot)eu> +% Copyright 2009,2011 Christian Schneider <software(at)chschneider(dot)eu> % % cgr@addto@macro: identical to l@addto@macro from koma-script % bundle v2.9t @@ -34,7 +34,7 @@ % \iffalse %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{combinedgraphics} -%<package> [2009/11/01 v0.0.2-alpha inclusion of combined EPS/LaTeX graphics] +%<package> [2011/06/15 v0.1.1-alpha inclusion of combined EPS/LaTeX graphics] %<*driver> \documentclass[a4paper]{ltxdoc} \usepackage{combinedgraphics} @@ -67,11 +67,13 @@ % % \changes{v0.0.1-alpha}{2009/10/04}{initial .dtx version} % \changes{v0.0.2-alpha}{2009/11/01}{initial release} +% \changes{v0.1.0-alpha}{2011/06/12}{added options for changing the inclusion +% order of \LaTeX{} and vector graphics parts} +% \changes{v0.1.1-alpha}{2011/06/15}{fix in Makefiles of package} % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% %\CheckSum{0} -% \CheckSum{528} +% \CheckSum{574} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -102,7 +104,7 @@ % % \title{The \textsf{combinedgraphics} package\thanks{This document corresponds % to \textsf{combinedgraphics}~\fileversion, dated~\filedate. Copyright -% 2009 Christian Schneider \texttt{<software(at)chschneider(dot)eu>}.}} +% 2009,2011 Christian Schneider \texttt{<software(at)chschneider(dot)eu>}.}} % \author{Christian Schneider\\ \texttt{<software(at)chschneider(dot)eu>}} % % \maketitle @@ -129,6 +131,10 @@ % \item automatic inclusion of the vector graphics parts, as far as \LaTeX{} % parts do not do it (e.\,g., for files exported from Gnuplot before % version 4.2 or Xfig) +% \item changing the inclusion order of \LaTeX{} and vector graphics +% parts (e.\,g., Gnuplot 4.4 exports files in a way that the vector +% graphics part overlays the \LaTeX{} part, which means that text may be +% hidden under shaded areas) % \item rescaling and rotating of complete graphics (similar to % |\includegraphics| from \textsf{graphicx} package) % \end{itemize} @@ -210,6 +216,10 @@ % code is required (default), |true|/|false| to always/never generate % that code, or |overwrite| to disable any inclusion of a vector graphics % part in the \LaTeX{} part and generate new code +% \item[\texttt{vecfirst}=\meta{value}] inclusion order of vector +% graphics part; valid \meta{value}s are: |true| (default) or |false| to +% include the vector graphics part before or after the \LaTeX{} part, +% respectively % \item[\texttt{vecfile}=\meta{value}] filename of vector graphics part, if % different from filename of \LaTeX{} part (except for extension); implies % |vecinclude=overwrite| @@ -295,6 +305,7 @@ % leading backslash) for recoloring text in \LaTeX{} part % \item[\texttt{vecscale}=\meta{value}] see section~\ref{sec:basic} % \item[\texttt{vecinclude}=\meta{value}] see section~\ref{sec:basic} +% \item[\texttt{vecfirst}=\meta{value}] see section~\ref{sec:basic} % \end{mydescription} % % \section{Bugs, problems, and suggestions} @@ -320,6 +331,11 @@ % % \subsection{Package options} % +% This |if| is required to remember the inclusion order. +% \begin{macrocode} +\newif\ifcgr@vecfirst +% \end{macrocode} +% % Definitions of package options as \meta{key}|=|\meta{value} pairs. The % \meta{value}s are saved in the specified macros that are undefined by default. % \begin{macrocode} @@ -329,6 +345,7 @@ \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}} % \end{macrocode} % % Next the package options are processed. @@ -395,14 +412,23 @@ } % \end{macrocode} % -% |vecinclude| switches between the different \meta{keys} by setting -% |\cgr@vecinclude| to one of the for macros |\cgr@requires@graphics|\meta{key}. +% |vecinclude| switches between the different \meta{value}s by setting +% |\cgr@vecinclude| to one of the for macros +% |\cgr@requires@graphics|\meta{value}. % \begin{macrocode} \cgr@defopts@combgrphcs{vecinclude}{% \def\cgr@vecinclude{\@nameuse{cgr@requires@graphics#1}}% } % \end{macrocode} % +% |vecfirst| switches between the \meta{value}s |true| and |false| by setting +% |\cgr@vecfirsttrue| or |\cgr@vecfirstfalse|, respectively. +% \begin{macrocode} +\cgr@defopts@combgrphcs{vecfirst}{% + \@nameuse{cgr@vecfirst#1}% +} +% \end{macrocode} +% % |vecfile| resets |\cgr@vecfile| that defaults to the mandatory argument of % |\includecombinedgraphics| to something else \emph{and} sets |vecinclude| to % |overwrite|. @@ -551,13 +577,14 @@ } % \end{macrocode} % -% Now the macros for the basic macro options and for temporarily saving +% Now the macros and |if| for the basic macro options and for temporarily saving % \meta{value}s of the extended macro options are initialized. % \begin{macrocode} \def\cgr@textfont{} \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{} @@ -588,17 +615,39 @@ }% % \end{macrocode} % -% Now the the macros resulting from the basic macro options, a |picture| -% environment with the vector graphics part and the \LaTeX{} part are added to -% the (empty) |\cgr@curr@pic| macro. +% Now the the macros resulting from the basic macro options, the vector +% graphics part and the \LaTeX{} part are added to the (empty) |\cgr@curr@pic| +% macro. We have to distinguish between two cases: +% (1) If the vector graphics part is included before the \LaTeX{} part +% (|vecfirst=true|), the vector graphics file will simply be loaded by +% |\includegraphics| inside a picture environment followed by the \LaTeX{} part +% included by |\input|. (2) If the vector graphics part is included after the +% \LaTeX{} part (|vecfirst=false|), the |\includegraphics| macro will be put +% inside the |picture| environment of the \LaTeX{} part at the offset position +% passed to the |picture| environment. Therefore, we will have to wrap the +% |\picture| macro to gain access to the offsets passed to the |picture| +% environment in the \LaTeX{} part and wrap the |\endpicture| macro to add +% |\includegraphics| into this |picture| environment. % \begin{macrocode} \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}% }% % \end{macrocode} @@ -618,6 +667,9 @@ \@ifundefined{cgr@vecinclude@default}{}{% \cgr@setopts@combgrphcs{vecinclude=\cgr@vecinclude@default}% }% + \@ifundefined{cgr@vecfirst@default}{}{% + \cgr@setopts@combgrphcs{vecfirst=\cgr@vecfirst@default}% + }% % \end{macrocode} % % Afterwards, the macro containing the name of the vector graphics part is @@ -715,6 +767,27 @@ } % \end{macrocode} % +% To play the trick of including the vector graphics part after the \LaTeX{} +% part (|vecfirst=false|), we need to know the offset passed to the picture +% environment in the \LaTeX{} part. Therefore, the |\picture| macro is +% redefined. +% \begin{macrocode} +\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)% +} +% \end{macrocode} +% % This macro is identical to |\l@addto@macro| from \textsf{koma-script bundle}. % It adds the stuff passed to its second argument to the end of the macro from % its first argument. 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@}}% |