From 385daa279ac68fc0277e25586e8745366abfb796 Mon Sep 17 00:00:00 2001 From: Manuel Pégourié-Gonnard Date: Tue, 2 Aug 2011 19:45:13 +0000 Subject: combinedgrphics update git-svn-id: svn://tug.org/texlive/trunk@23356 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/combinedgraphics/Makefile | 65 ------------- .../latex/combinedgraphics/combinedgraphics.dtx | 101 ++++++++++++++++++--- 2 files changed, 87 insertions(+), 79 deletions(-) delete mode 100644 Master/texmf-dist/source/latex/combinedgraphics/Makefile (limited to 'Master/texmf-dist/source/latex/combinedgraphics') diff --git a/Master/texmf-dist/source/latex/combinedgraphics/Makefile b/Master/texmf-dist/source/latex/combinedgraphics/Makefile deleted file mode 100644 index ae99f280867..00000000000 --- a/Master/texmf-dist/source/latex/combinedgraphics/Makefile +++ /dev/null @@ -1,65 +0,0 @@ -# -# Makefile for combinedgraphics package -# -# Copyright 2009 Christian Schneider -# -# This file is part of combinedgraphics. -# -# combinedgraphics is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 3 as -# published by the Free Software Foundation, not any later version. -# -# combinedgraphics is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with combinedgraphics. If not, see . -# -# WARNING: THIS IS ALPHA SOFTWARE AND MAY CONTAIN SERIOUS BUGS! -# - -PACKAGE := combinedgraphics - -PDFLATEX := pdflatex -MAKEINDEX := makeindex - -.PHONY: all pkg doc test clean distclean force - -all: pkg doc test - -%.sty: %.ins %.dtx - $(RM) $@ - $(PDFLATEX) -interaction=nonstopmode $< - -%.idx %.glo: %.dtx %.sty - $(PDFLATEX) -interaction=nonstopmode $< - -%.ind: %.idx - $(MAKEINDEX) -s gind.ist -o $@ $< - -%.gls: %.glo - $(MAKEINDEX) -s gglo.ist -o $@ $< - -$(PACKAGE).pdf: %.pdf: %.dtx %.sty %.ind %.gls - $(PDFLATEX) -interaction=nonstopmode $< - $(PDFLATEX) -interaction=nonstopmode $< - $(PDFLATEX) -interaction=nonstopmode $< - -pkg: $(PACKAGE).sty - -test: $(PACKAGE).sty force - $(MAKE) -C test - -doc: $(PACKAGE).pdf - -clean: force - $(RM) *.aux *.glo *.gls *.idx *.ilg *.ind *.log *.toc *~ - $(MAKE) -C test clean - -distclean: clean force - $(RM) $(PACKAGE).sty $(PACKAGE).pdf $(TESTFILE).pdf - $(MAKE) -C test distclean - -force: ; 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 +% Copyright 2009,2011 Christian Schneider % % cgr@addto@macro: identical to l@addto@macro from koma-script % bundle v2.9t @@ -34,7 +34,7 @@ % \iffalse %\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] %<*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{}.}} +% 2009,2011 Christian Schneider \texttt{}.}} % \author{Christian Schneider\\ \texttt{}} % % \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. -- cgit v1.2.3