From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/emp/COPYING | 339 ++++++++++++++ macros/latex/contrib/emp/Makefile | 180 ++++++++ macros/latex/contrib/emp/README | 51 +++ macros/latex/contrib/emp/emp.dtx | 863 ++++++++++++++++++++++++++++++++++++ macros/latex/contrib/emp/emp.ins | 80 ++++ macros/latex/contrib/emp/emp.pdf | Bin 0 -> 141646 bytes macros/latex/contrib/emp/empman.pdf | Bin 0 -> 111798 bytes 7 files changed, 1513 insertions(+) create mode 100644 macros/latex/contrib/emp/COPYING create mode 100644 macros/latex/contrib/emp/Makefile create mode 100644 macros/latex/contrib/emp/README create mode 100644 macros/latex/contrib/emp/emp.dtx create mode 100644 macros/latex/contrib/emp/emp.ins create mode 100644 macros/latex/contrib/emp/emp.pdf create mode 100644 macros/latex/contrib/emp/empman.pdf (limited to 'macros/latex/contrib/emp') diff --git a/macros/latex/contrib/emp/COPYING b/macros/latex/contrib/emp/COPYING new file mode 100644 index 0000000000..e77696ae8d --- /dev/null +++ b/macros/latex/contrib/emp/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/macros/latex/contrib/emp/Makefile b/macros/latex/contrib/emp/Makefile new file mode 100644 index 0000000000..13270097be --- /dev/null +++ b/macros/latex/contrib/emp/Makefile @@ -0,0 +1,180 @@ +# Makefile -- install emp. +# Copyright (C) 1997 Thorsten.Ohl@Physik.TH-Darmstadt.de +# +# Emp is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# Emp 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 this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# $Id: Makefile,v 1.6 1997/11/12 21:14:41 ohl Exp $ +# +######################################################################## + +VERSION = 1 +RELEASE = 00 +STATUS = + +######################################################################## + +# Directories +prefix = $(HOME) +texdir = $(prefix)/tex/inputs +docdir = $(texdir)/doc + +# Commands +INSTALL = install -c -m 755 +INSTALL_DATA = install -c -m 644 +# INSTALL = cp +# INSTALL_DATA = cp + +LATEX = latex +MP = TEX=$(LATEX) mpost +MAKEINDEX = makeindex +DVIPS = dvips +DFLAGS = + +######################################################################## +# No user serviceable parts below: +######################################################################## + +RESOLVE_XREF = \ + $(LATEX) $*.drv && \ + while grep 'Rerun to get cross-references right\.' $*.log; \ + do \ + $(LATEX) $*.drv; \ + done + +RUN_MAKEINDEX = \ + $(MAKEINDEX) -s gind.ist -o $*.ind $*.idx && \ + $(MAKEINDEX) -s gglo.ist -o $*.gls $*.glo + +all: emp.sty emp.drv + +man: empman.dvi + +ps: emp.ps + +dvi: emp.dvi + +install: all + $(INSTALL_DATA) emp.sty $(texdir) + +install.doc: all + $(INSTALL_DATA) emp.dtx $(docdir) + $(INSTALL_DATA) emp.drv $(docdir) + $(INSTALL_DATA) empman.drv $(docdir) + +uninstall: + rm -f $(texdir)/emp.sty + +uninstall.doc: + rm -f $(docdir)/emp.dtx + rm -f $(docdir)/emp.drv + rm -f $(docdir)/empman.drv + +emp.sty: emp.dtx emp.ins + $(LATEX) emp.ins + +emp.drv empman.drv: emp.sty + +emp.dvi: emp.dtx emp.drv emp.sty + -$(LATEX) $*.drv + $(MP) $* + -$(LATEX) $*.drv + $(RUN_MAKEINDEX) + $(RESOLVE_XREF) + +empman.dvi: emp.dtx empman.drv emp.sty + -$(LATEX) $*.drv + $(MP) $* + -$(LATEX) $*.drv + $(RUN_MAKEINDEX) + $(RESOLVE_XREF) + +manual.ps.gz: manual.ps + gzip < $< > $@ + +manual.ps: empman.dvi $(MANPICS) + $(DVIPS) $(DFLAGS) -o $@ $< + +emp.ps: emp.dvi $(MANPICS) + $(DVIPS) $(DFLAGS) -o $@ $< + +clean: + rm -f *.mp *.rawmp *.[0-9]* \ + *.log *.dvi *.aux *.toc *.ilg *.glo *.gls *.idx *.ind \ + *.ps *.mpx '#*#' *~ .*~ + +realclean: clean + rm -f emp.sty emp.drv empman* + +distclean: realclean + +######################################################################## +# Maintenance: + +DISTFILES = /usr/local/etc/COPYING README Makefile emp.dtx emp.ins + +distdir = emp-$(VERSION).$(RELEASE)$(STATUS) +CVSTAG = EMP_$(VERSION)_$(RELEASE)$(STATUS) +TEXTAG = v$(VERSION).$(RELEASE) +M = + +fileversion: + perl -pe \ + 's/^\\def\\fileversion\{.*\}/\\def\\fileversion{$(TEXTAG)}/;' \ + emp.dtx > emp.vtmp + if cmp -s emp.dtx emp.vtmp; then \ + rm -f emp.vtmp; \ + else \ + mv emp.vtmp emp.dtx; \ + fi + +commit: fileversion + @if test -n "$(M)"; then \ + echo "cvs commit -m '$(M)'"; cvs commit -m '$(M)'; \ + echo "cvs tag $(CVSTAG)"; cvs tag $(CVSTAG); \ + echo "cvs tag -b $(CVSTAG)_"; cvs tag -b $(CVSTAG)_; \ + else \ + echo "usage: make commit M=''" 1>&2; \ + fi + +dist: $(distdir).tar.gz +snap: emp-current.tar.gz + +$(distdir).tar.gz: + rm -fr $(distdir) $(distdir).tmp + cvs export -r $(CVSTAG) -d $(distdir).tmp emp + mkdir $(distdir) + (cd ./$(distdir).tmp && \ + make $(DISTFILES) && \ + cp $(DISTFILES) ../$(distdir)) + tar cf - $(distdir) | gzip > $@ + rm -fr $(distdir) $(distdir).tmp + +emp-current.tar.gz: $(DISTFILES) fileversion + rm -fr emp-current + mkdir emp-current + touch emp-current/1_THIS_IS_A_SNAPSHOT_OF_ + touch emp-current/2_WORK_IN_PROGRESS_AND__ + touch emp-current/3_NOT_YET_RELEASED_CODE_ + cp $(DISTFILES) emp-current +# perl -pe \ +# 's/\[\\filedate/[(UNRELEASED and UNSUPPORTED snapshot)/;' \ + emp.dtx > emp-current/emp.dtx + tar cf - emp-current | gzip > $@ + rm -fr emp-current + +######################################################################## +# Local Variables: +# mode:text +# End: diff --git a/macros/latex/contrib/emp/README b/macros/latex/contrib/emp/README new file mode 100644 index 0000000000..2acd1fac7a --- /dev/null +++ b/macros/latex/contrib/emp/README @@ -0,0 +1,51 @@ +# $Id: README,v 1.3 1997/11/12 21:19:24 ohl Exp $ +######################################################################## + + This is emp, a package for encapsulated MetaPost pictures in LaTeX. + This is very useful for keeping illustrations in sync with the + text. It also frees the user from inventing descriptive names + for PostScript files that fit into the confines of file system + conventions. + + You are invited to share, use, abuse, and improve it, see the file + COPYING for details. + + Enjoy, + -Thorsten + + +######################################################################## + + Comments, bug reports and improvements are welcome at: + + Thorsten.Ohl@Physik.TH-Darmstadt.de + (aka: ohl@crunch.ikp.physik.th-darmstadt.de) + + New versions can be found in: + + crunch.ikp.physik.th-darmstadt.de:/pub/ohl/emp + + or at CTAN: + + {ftp.tex.ac.uk,ftp.dante.de}: + ... macros/latex/contrib/supported/emp + +######################################################################## + +NEWS for Version 0.01 + + * Created. + +######################################################################## + +WARNING: + + If LaTeX fails with `Unknown graphics extension: 3', you have a + severely out-of-date graphics.sty file (LaTeX will have issued a + warning in this case). There has been a change to the user + interface, which makes it very hard to support both versions. + +######################################################################## +# Local Variables: +# mode:indented-text +# End: diff --git a/macros/latex/contrib/emp/emp.dtx b/macros/latex/contrib/emp/emp.dtx new file mode 100644 index 0000000000..b502e62f7c --- /dev/null +++ b/macros/latex/contrib/emp/emp.dtx @@ -0,0 +1,863 @@ +% \iffalse % emp.dtx - Encapsulated MetaPost for LaTeX(2e) +% Copyright (C) 1997 by Thorsten.Ohl@Physik.TU-Darmstadt.de +% $Id: emp.dtx,v 1.10 1997/11/12 21:14:41 ohl Exp $ +% +% Emp is free software; you can redistribute it and/or modify it +% under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2, or (at your option) +% any later version. +% +% Emp 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 this program; if not, write to the Free Software +% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +% +% \fi +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%% \CheckSum{291} +%% \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 +%% Lower-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 +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +%% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \MakeShortVerb{\|} +% +% \title{% +% \EMP: \\ +% Encapsulated \MP{} for \LaTeX\thanks{% +% This is \texttt{\filename}, version \fileversion, +% revision \filerevision, date \filedate.}} +% +% \author{% +% Thorsten Ohl\thanks{e-mail: +% \texttt{Thorsten.Ohl@Physik.TU-Darmstadt.de}}\\ +% \hfil \\ +% Technische Hochschule Darmstadt \\ +% Schlo\ss gartenstr. 9 \\ +% D-64289 Darmstadt \\ +% Germany} +% +% \maketitle +% \begin{abstract} +% The \EMP{} package allows to encapsulate \MP{} files in \LaTeX{} +% sources. This is very useful for keeping illustrations in sync +% with the text. It also frees the user from inventing descriptive +% names for PostScript files that fit into the confines of file +% system conventions. +% \end{abstract} +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \vfill +% \section*{Copying} +% +% \EMP{} is free software; you can redistribute it and/or modify it +% under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2, or (at your option) +% any later version. +% +% \EMP{} is distributed in the hope that it will be useful, but +% \emph{without any warranty}; without even the implied warranty of +% \emph{merchantability} or \emph{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 this program; if not, write to the Free Software +% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \newpage +% \unitlength=1mm +% \def\topfraction{0.9} +% \def\bottomfraction{0.9} +% \def\textfraction{0.1} +% \empaddtoTeX{\usepackage{amsmath}} +% \empprelude{input graph} +% \begin{empfile} +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \section{Introduction} +% +% When adding illustrations to documents, one faces two bookkeeping +% problems: +% \begin{enumerate} +% \item How to encourage oneself to keep the illustrations in sync +% with the text, when the document is updated? +% \item How to make sure that the illustrations appear on the right +% spot? +% \end{enumerate} +% For both problems, the best solution is to encapsulate the figures +% in the \LaTeX{} source: +% \begin{enumerate} +% \item It is much easier to remember to update an illustration if +% one doesn't have to switch files in the editor. +% \item One does not have to invent illustrative file names, if +% the computer keeps track of them. +% \end{enumerate} +% Therefore \EMP{} was written to allow to encapsulate +% \MP~\cite{MP,LaTeX-Graphics-Companion} into +% \LaTeX~\cite{LaTeX-Graphics-Companion,LaTeX,LaTeX-Companion}. +% +% These macros have some overlap with +% \FMF~\cite{LaTeX-Graphics-Companion,FeynMF}, +% |axodraw|~\cite{axodraw} and +% |mfpic|~\cite{LaTeX-Graphics-Companion,mfpic}. In fact, most of the +% functionality of \EMP{} is available from \FMF. Longer pieces of +% \MP{} code are however not very conveniently typed in \FMF, because +% there is no facility for multi line input (using |\fmfcmd| with long +% arguments can overflow \MP's input buffers because of the missing +% line breaks). Since \FMF{} provides much syntax that is superfluous +% for \EMP's purpose (the \EMP{} package exports only five new +% environments and five commands), it is more appropriate to create a +% separate small package than to add this functionality to \FMF. +% Similar comments apply to |mfpic|. +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \section{Usage} +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \subsection{Commands and Environments} +% \label{sec:commands} +% +% \DescribeEnv{empfile} +% All descriptions that should go into one \MP{} file are placed +% inside a |empfile| environment which takes the name of the \MP{} +% file as an optional argument: +% \begin{quote} +% \begin{flushleft} +% |\begin{empfile}[|\meta{\MP-file}|]|\\ +% \qquad\ldots\\ +% |\end{empfile}| +% \end{flushleft} +% \end{quote} +% The default \MP-filename is |\jobname.mp|. +% +% \DescribeEnv{emp} +% The |emp| environment contains the description of a single +% figure that will be placed at the location of the environment. +% Required arguments are the width and the height of the figure, in +% units of |\unitlength|. They will be available as the \MP{} +% variables~|w| and~|h|. The optional argument assigns a name to be +% used with |\empuse{|\meta{name}|}|. +% \begin{quote} +% \begin{flushleft} +% |\begin{emp}[|\meta{name}|](|\meta{width}|,|\meta{height}|)|\\ +% \qquad\meta{\MP-commands}\\ +% |\end{emp}| +% \end{flushleft} +% \end{quote} +% Note that this environment uses the |verbatim| package to process +% the input lines and can therefore \emph{not} be used as an argument +% to another macros. To work around this problem, you can first use +% the |empdef| environment and |\empuse| it later. +% +% \DescribeMacro{\empuse} +% Reuse a previously defined figure. +% +% \DescribeEnv{empdef} +% The |empdef| environment is similar to |emp|, but the figure is not +% drawn. This is useful, because these environments use the +% |verbatim| package and can therefore \emph{not} be used as an +% argument to another macros. +% \begin{quote} +% \begin{flushleft} +% |\begin{empdef}[|\meta{name}|](|\meta{width}|,|\meta{height}|)|\\ +% \qquad\meta{\MP-commands}\\ +% |\end{empdef}| +% \end{flushleft} +% \end{quote} +% +% \DescribeEnv{empcmds} +% Write \MP{} commands to the current file outside of a figure. +% \begin{quote} +% \begin{flushleft} +% |\begin{empcmds}|\\ +% \qquad\meta{\MP-commands}\\ +% |\end{empcmds}| +% \end{flushleft} +% \end{quote} +% +% \DescribeEnv{empgraph} +% The |empgraph| environment contains the description of a graph +% that will be placed a the location of the environment. +% The user is responsible for including the |graph| package by the +% using the command |\empprelude{input graph}| in the preamble. +% Required arguments are the width and +% the height of the graph, in units of |\unitlength|. They will be +% available as the \MP{} variables~|w| and~|h|. The optional argument +% assigns a name to be used with |\empuse{|\meta{name}|}|. +% \begin{quote} +% \begin{flushleft} +% |\begin{empgraph}[|\meta{name}|](|\meta{width}|,|\meta{height}|)|\\ +% \qquad\meta{\MP-commands}\\ +% |\end{empgraph}| +% \end{flushleft} +% \end{quote} +% +% \DescribeMacro{\empTeX} +% Define a \LaTeX{} prelude to be written to the top of every \MP{} +% file. The default is |\documentclass[|\meta{ptsize}|]{article}|. +% If the prelude is not empty, |\begin{document}| will be added. Note +% that you have to run \MP{} as |TEX=latex mpost| \meta{filename} if the +% prelude calls \LaTeX. +% +% \DescribeMacro{\empaddtoTeX} +% Add to the \LaTeX{} prelude. +% E.g.~|\empaddtoTeX{\usepackage{euler}}| makes sure that \MP{} will +% use the Euler fonts for the labels. +% +% \DescribeMacro{\empprelude} +% \DescribeMacro{\empaddtoprelude} +% Define and add to a \MP{} prelude to the top of every \MP{} file. +% The default is empty. +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \subsection{Examples} +% \label{sec:examples} +% +% For a simple example, let's draw a smiling and a frowning face. +% Since they are identical except for the mouth, we prepare a macro +% for the common parts: +% \begin{macrocode} +%<*sample> +\begin{empcmds} + vardef draw_face = + pair lefteye, righteye, nose[]; + lefteye = c + (-0.25w,0.15h); righteye = c + (0.25w,0.15h); + nose1 = c - (0,0.05h); nose2 = c + (0,0.15h); + pickup pencircle scaled 1; + draw fullcircle xscaled w yscaled h shifted c; + draw fullcircle scaled 2 shifted lefteye; + draw fullcircle scaled 2 shifted righteye; + draw nose1--nose2; draw mouth1..mouth2..mouth3; + setbounds currentpicture to unitsquare xscaled w yscaled .5h; + enddef; +\end{empcmds} +% \end{macrocode} +% \begin{empcmds} + vardef draw_face = + pair lefteye, righteye, nose[]; + lefteye = c + (-0.25w,0.15h); righteye = c + (0.25w,0.15h); + nose1 = c - (0,0.05h); nose2 = c + (0,0.15h); + pickup pencircle scaled 1; + draw fullcircle xscaled w yscaled h shifted c; + draw fullcircle scaled 2 shifted lefteye; + draw fullcircle scaled 2 shifted righteye; + draw nose1--nose2; draw mouth1..mouth2..mouth3; + setbounds currentpicture to unitsquare xscaled w yscaled .5h; + enddef; +\end{empcmds} +% This can now be used for the frowning +% \begin{emp}[frown](5,5) + pair mouth[], c; c = (0.5w,0); + mouth1 = c + (-0.2w,-0.25h); + mouth2 = c + (0,-0.2h); + mouth3 = c + (0.2w,-0.25h); + draw_face; +\end{emp} +% \begin{macrocode} +\begin{emp}(5,5) + pair mouth[], c; c = (0.5w,0); + mouth1 = c + (-0.2w,-0.25h); + mouth2 = c + (0,-0.2h); + mouth3 = c + (0.2w,-0.25h); + draw_face; +\end{emp} +% \end{macrocode} +% and the smiling +% \begin{emp}[smile](5,5) + pair mouth[], c; c = (0.5w,0); + mouth1 = c + (-0.2w,-0.2h); + mouth2 = c + (0,-0.25h); + mouth3 = c + (0.2w,-0.2h); + draw_face; +\end{emp} +% face +% \begin{macrocode} +\begin{emp}[smile](5,5) + pair mouth[], c; c = (0.5w,0); + mouth1 = c + (-0.2w,-0.2h); + mouth2 = c + (0,-0.25h); + mouth3 = c + (0.2w,-0.2h); + draw_face; +\end{emp} +% \end{macrocode} +% Since we have given a name to |smile|, we can now use it with +% |\empuse{smile}|: +% \begin{itemize} +% \item[\empuse{smile}] Note that the reference point has been set +% up such that it works best as replacement for |\bullet| in +% |itemize| environments. +% \item[\empuse{smile}] This is very useful for slides. +% \end{itemize} +% +% \begin{figure} +% \begin{center} +% \begin{empgraph}(60,40) + pickup pencircle scaled 1pt; + path p; + for x = -20 step 0.2 until -0.2: + augment.p (x, sind(x*180/3.14159)/x); + endfor + augment.p (0, 1); + for x = 0.2 step 0.2 until 20: + augment.p (x, sind(x*180/3.14159)/x); + endfor + gdraw p; + glabel.lrt (btex $\displaystyle\frac{\sin(x)}{x}$ etex, (-20,1)); +\end{empgraph} +% \vspace*{-1.5\baselineskip} +% \end{center} +% \caption{\label{fig:graph}% +% \texttt{graph} example.} +% \end{figure} +% As a second example, the simple plot of +% \begin{equation} +% j_0 = \frac{\sin(x)}{x} +% \end{equation} +% is shown in figure~\ref{fig:graph}: +% \begin{macrocode} +\begin{empgraph}(60,40) + pickup pencircle scaled 1pt; + path p; + for x = -20 step 0.2 until -0.2: + augment.p (x, sind(x*180/3.14159)/x); + endfor + augment.p (0, 1); + for x = 0.2 step 0.2 until 20: + augment.p (x, sind(x*180/3.14159)/x); + endfor + glabel.lrt (btex $$\displaystyle\frac{\sin(x)}{x}$$ etex, (-20,1)); + gdraw p; +\end{empgraph} +% \end{macrocode} +% The command |\empprelude{input graph}| must have been put in the +% preamble to make the |graph| package available. +% +% \begin{figure} +% \begin{center} +% \begin{empgraph}(60,40) + pi = 3.14159; beta0 = 11 - 2/3*4; + lambda1 = 0.15; lambda2 = 0.25; + vardef ln expr x = (mlog x) / 256 enddef; + vardef alphas (expr x, l) = 4*pi/(beta0*2ln(x/l)) enddef; + setcoords (log,linear); + pickup pencircle scaled 1pt; + path p[]; + for x = 0.5 step 0.1 until 10: + augment.p1 (x, alphas (x, lambda1)); + augment.p2 (x, alphas (x, lambda2)); + endfor + gfill p1--(reverse p2)--cycle withcolor .5white; + glabel.lft (btex $\alpha_s(Q^2)$ etex rotated 90, OUT); + glabel.bot (btex $Q^2/\text{GeV}$ etex, OUT); +\end{empgraph} +% \vspace*{-1.5\baselineskip} +% \end{center} +% \caption{\label{fig:alphas}% +% Another \texttt{graph} example.} +% \end{figure} +% Finally, another application of the |graph| package: +% \begin{equation} +% \alpha_s(Q^2) = \frac{4\pi}{\beta_0\ln(Q^2/\Lambda_{\text{QCD}}^2)} +% \end{equation} +% with $\Lambda_{\text{QCD}}\in[0.15\,\text{GeV},0.25\,\text{GeV}]$ +% and $\beta_0=11-2N_f/3$ is shown in figure~\ref{fig:alphas}: +% \begin{macrocode} +\begin{empgraph}(60,40) + pi = 3.14159; beta0 = 11 - 2/3*4; + lambda1 = 0.15; lambda2 = 0.25; + vardef ln expr x = (mlog x) / 256 enddef; + vardef alphas (expr x, l) = 4*pi/(beta0*2ln(x/l)) enddef; + setcoords (log,linear); + pickup pencircle scaled 1pt; + path p[]; + for x = 0.5 step 0.1 until 10: + augment.p1 (x, alphas (x, lambda1)); + augment.p2 (x, alphas (x, lambda2)); + endfor + gfill p1--(reverse p2)--cycle withcolor .5white; + glabel.lft (btex $\alpha_s(Q^2)$ etex rotated 90, OUT); + glabel.bot (btex $Q^2/\text{GeV}$ etex, OUT); +\end{empgraph} +% +% \end{macrocode} +% Note that the |\text| macro of AMS-\LaTeX{} has been used, +% therefore, the command |\empaddtoTeX{\usepackage{amsmath}}| must +% have been put in the preamble for this example to work. +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \begin{thebibliography}{99} +% \bibitem{MP} John D.~Hobby, \textit{A User's Manual for +% \MP}, Computer Science Report \#162, AT\&T Bell +% Laboratories, April 1992. +% \bibitem{LaTeX-Graphics-Companion} Michel Goossens, Sebastian +% Rahtz, and Frank Mittelbach, \textit{The \LaTeX{} Graphics +% Companion}, Addison-Wesley, Reading MA, 1997. +% \bibitem{LaTeX} Leslie Lamport, \textit{\LaTeX{} --- A +% Documentation Preparation System}, +% Addison-Wesley, Reading MA, 1985. +% \bibitem{LaTeX-Companion} Michel Goossens, Frank Mittelbach, and +% Alexander Samarin, \textit{The \LaTeX{} Companion}, +% Addison-Wesley, Reading MA, 1994. +% \bibitem{FeynMF} Thorsten Ohl, +% Comp.~Phys.~Comm.~\textbf{90} (1995) 340; +% CERN Computer Newsletter~\textbf{220} (1995) 22; +% \textbf{221} (1995) 46; \textbf{222} (1996) 24. +% \texttt{axodraw} is available from CTAN +% (cf.~p.~\pageref{pg:CTAN}), in the +% \texttt{latex/contrib/supported} directory. +% \bibitem{axodraw} Jos Vermaseren, +% Comp.~Phys.~Comm.~\textbf{83} (1994) 45. +% \texttt{axodraw} is available from CTAN +% (cf.~p.~\pageref{pg:CTAN}), in the \texttt{graphics} directory. +% \bibitem{mfpic} Thomas E.~Leathrum, \texttt{mfpic}, available from +% CTAN (cf.~p.~\pageref{pg:CTAN}), in the \texttt{graphics} +% directory. +% \end{thebibliography} +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \section*{Distribution} +% \label{sec:distribution} +% +% \EMP{} is available by anonymous internet ftp from any of the +% Comprehensive \TeX{} Archive Network (CTAN) hosts +% \label{pg:CTAN} +% \begin{quote} +% |ftp.tex.ac.uk|, |ftp.dante.de| +% \end{quote} +% in the directory +% \begin{quote} +% |macros/latex/contrib/supported/emp| +% \end{quote} +% It is also available from the host +% \begin{quote} +% |crunch.ikp.physik.tu-darmstadt.de| +% \end{quote} +% in the directory +% \begin{quote} +% |pub/ohl/emp| +% \end{quote} +% Unsupported snapshots of work in progress are provided as +% \begin{quote} +% |pub/ohl/emp.versions/emp-current.tar.gz| +% \end{quote} +% ^^A There are two mailing lists +% ^^A \begin{quote} +% ^^A \begin{flushleft} +% ^^A |emp-announce@crunch.ikp.physik.tu-darmstadt.de|\\ +% ^^A |emp-bugs@crunch.ikp.physik.tu-darmstadt.de| +% ^^A \end{flushleft} +% ^^A \end{quote} +% ^^A open for subscription. The former should carry only important +% ^^A announcements, of new versions in particular. To subscribe, send +% ^^A mail to the (electronic) mailing list manager +% ^^A \begin{quote} +% ^^A |majordomo@crunch.ikp.physik.tu-darmstadt.de| +% ^^A \end{quote} +% ^^A and \emph{not} to the lists itself. The following commands (on a +% ^^A line in the body of the mail, not in the subject) are useful: +% ^^A \begin{quote} +% ^^A \begin{flushleft} +% ^^A |subscribe emp-announce|\\ +% ^^A |unsubscribe emp-announce|\\ +% ^^A |help| +% ^^A \end{flushleft} +% ^^A \end{quote} +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \end{empfile} +% \StopEventually{\PrintIndex\PrintChanges} +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \section{Implementation} +% \changes{v1.00}{1997/11/12}{Version 1.00 frozen.} +% +% It's is good practice to identify this version of the document style +% option. We do this by parsing an RCS |Id| string and storing the +% result in the conventional \TeX{} control sequences: +% \begin{macrocode} +%<*style> +\def\fileversion{v1.00} +\NeedsTeXFormat{LaTeX2e} +{\def\RCS#1#2\endRCS{% + \ifx$#1% + \@RCS $#2 \endRCS + \else + \@RCS $*: #1#2$ \endRCS + \fi}% + \def\@RCS $#1: #2,v #3 #4 #5 #6 #7$ \endRCS{% + \gdef\filename{#2}% + \gdef\filerevision{#3}% + \gdef\filedate{#4}% + \gdef\filemaintainer{#6}}% +\RCS $Id: emp.dtx,v 1.10 1997/11/12 21:14:41 ohl Exp $ \endRCS}% +% \end{macrocode} +% +% And now the standard procedure: +% \begin{macrocode} +\ProvidesPackage{emp}[\filedate\space\fileversion\space + Encapsulated MetaPost LaTeX Package (\filemaintainer)] +% \end{macrocode} +% Every option we don't understand is sent down to |graphics|: +% \begin{macrocode} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphics}} +\ProcessOptions +\RequirePackage{graphics}[1994/12/15] +\RequirePackage{verbatim} +% \end{macrocode} +% +% \begin{macro}{\empwrite} +% \begin{macrocode} +{\catcode`\%=11\gdef\p@rcent{%}} +\def\empwrite#1{% + \if@empio + \immediate\write\@outemp{#1}% + \fi + \ignorespaces} +\newif\if@empio +\@empiotrue +\newwrite\@outemp +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\empfile} +% This environment encloses each \MP{} input file. The single optional +% argument gives the name of the file. +% \begin{macrocode} +\newcommand{\empfile}[1][\jobname]{% + \def\theempfile{#1}% +% \end{macrocode} +% Open the \MP{} file. If we're running under AMS-\LaTeX, turn off +% I/O during the first pass over equation environments. +% \begin{macrocode} + \if@empio + \@ifundefined{ifmeasuring@}% + {}% + {\def\if@empio{\ifmeasuring@\else}}% + \immediate\openout\@outemp=\theempfile.mp\relax + \empwrite{\p@rcent\p@rcent\p@rcent\space \theempfile.mp -- % + do not edit, generated automatically by \jobname.tex}% +% \end{macrocode} +% append |\begin{document}| to a non-empty |\LaTeX| prelude and write +% it out: +% \begin{macrocode} + \expandafter\ifx\expandafter*\the\emp@TeX*\else + \emp@TeX=\expandafter{\the\emp@TeX^^J\begin{document}}% + \empwrite{verbatimtex^^J\the\emp@TeX^^Jetex;}% + \fi + \expandafter\ifx\expandafter*\the\emp@prelude*\else + \empwrite{\the\emp@prelude;}% + \fi + \fi +% \end{macrocode} +% Count the figures +% \begin{macrocode} + \setcounter{empfig}{0}} +\let\theempfile\relax +\newcounter{empfig} +% \end{macrocode} +% Standard preludes: +% \begin{macrocode} +\newtoks\emp@TeX +\ifcase\@ptsize + \emp@TeX={\documentclass[10pt]{article}} +\or + \emp@TeX={\documentclass[11pt]{article}} +\or + \emp@TeX={\documentclass[12pt]{article}} +\else + \emp@TeX={\documentclass{article}} +\fi +\newtoks\emp@prelude +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\empTeX} +% \begin{macro}{\empaddtoTeX} +% \begin{macro}{\empprelude} +% \begin{macro}{\empaddtoprelude} +% \begin{macrocode} +\def\empTeX#1{\emp@TeX={#1}} +\def\empaddtoTeX#1{\emp@TeX=\expandafter{\the\emp@TeX^^J#1}} +\def\empprelude#1{\emp@prelude={#1}} +\def\empaddtoprelude#1{\emp@prelude=\expandafter{\the\emp@prelude^^J#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\endempfile} +% And here is how we close the |empfile| environment: +% \begin{macrocode} +\def\endempfile{% + \expandafter\ifx\expandafter*\the\emp@TeX*\else + \empwrite{verbatimtex^^J\string\end{document}^^Jetex;}% + \fi + \empwrite{\p@rcent\p@rcent\p@rcent\space the end.^^J% + end.^^J% + endinput;}% + \let\theempfile\relax + \if@empio + \immediate\closeout\@outemp + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\emp} +% \begin{macrocode} +\newcommand{\emp}[1][*]{% + \def\emp@@name{#1}% + \emp@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\emp@} +% \begin{macrocode} +\def\emp@(#1,#2){% + \emp@start{#1}{#2}% + \emp@includegraphics{\theempfile}{\theempfig}% + \empcmds} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\emp@start} +% \begin{macrocode} +\def\emp@start#1#2{% + \emp@checkfile +% \end{macrocode} +% We can't use |\stepcounter| because of the |amstext| option of +% AMS-\LaTeX{} disables it sometimes. +% \begin{macrocode} + \global\expandafter\advance\csname c@empfig\endcsname \@ne + \emp@@def{\emp@@name}% +% \end{macrocode} +% Start the \MP{} figure: +% \begin{macrocode} + \empwrite{beginfig(\theempfig);^^J% + LaTeX_unitlength := \the\unitlength;^^J% + w := #1*LaTeX_unitlength;^^J% + h := #2*LaTeX_unitlength;}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\emp@checkfile} +% Make sure that a \MP{} file is open, otherwise \emph{really} +% obscure error messages are possible: +% \begin{macrocode} +\def\emp@checkfile{% + \ifx\theempfile\relax + \errhelp={Outside a empfile environment, I have no clue as to where^^J% + the MetaPost commands should go. I will use empdefault.mp^^J% + for this graph, but you'd better fix your code!}% + \errmessage{I detected a emp environment outside of empfile}% + \empfile[empdefault] + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\emp@includegraphics} +% \begin{macrocode} +\def\emp@includegraphics#1#2{% + \leavevmode + \IfFileExists{#1.#2}% + {\includegraphics{#1.#2}}% + {\typeout{% + emp: File #1.#2\space not found:^^J% + emp: Process #1.mp with MetaPost and then % + reprocess this file.}}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\empcmds} +% Write to the file: +% \begin{macrocode} +\def\empcmds{% + \begingroup + \@bsphack + \let\do\@makeother\dospecials + \catcode`\^^M\active + \def\verbatim@processline{\empwrite{\the\verbatim@line}}% + \verbatim@start}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endempcmds} +% \begin{macrocode} +\def\endempcmds{% + \@esphack + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endemp} +% \begin{macrocode} +\def\endemp{% + \endempcmds + \empwrite{endfig;}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\empdef} +% \begin{macrocode} +\newcommand{\empdef}[1][\relax]{% + \def\emp@@name{#1}% + \emp@def} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\emp@def} +% \begin{macrocode} +\def\emp@def(#1,#2){% + \emp@start{#1}{#2}% + \empcmds} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endempdef} +% \begin{macrocode} +\def\endempdef{\endemp} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\emp@@def} +% \begin{macrocode} +\def\emp@@def#1{% + \global\e@namedef{emp@k:f:#1}{\theempfile}% + \global\e@namedef{emp@k:c:#1}{\theempfig}} +\def\e@namedef#1{\expandafter\edef\csname #1\endcsname} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\empgraph} +% \begin{macrocode} +\newcommand{\empgraph}[1][*]{% + \def\emp@@name{#1}% + \emp@graph} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\emp@graph} +% \begin{macrocode} +\def\emp@graph(#1,#2){% + \emp@start{#1}{#2}% + \empwrite{draw begingraph (w, h);}% + \emp@includegraphics{\theempfile}{\theempfig}% + \empcmds} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\endempgraph} +% \begin{macrocode} +\def\endempgraph{% + \endempcmds + \empwrite{endgraph;^^Jendfig;}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\empuse} +% \begin{macrocode} +\def\empuse#1{% + \@ifundefined{emp@k:f:#1}% + {\typeout{emp: \string\empuse: `#1' undefined!}}% + {\emp@includegraphics{\@nameuse{emp@k:f:#1}}{\@nameuse{emp@k:c:#1}}}} +% +% \end{macrocode} +% \end{macro} +% +% \Finale +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \appendix +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \section{Driver File} +% +% \begin{macrocode} +%<*driver> +\documentclass[a4paper]{article} +\usepackage{doc} +\usepackage{amsmath} +% \end{macrocode} +% The \MF{} and \MP{} logos come out much nicer if you have |mflogo| +% installed: +% \begin{macrocode} +\IfFileExists{mflogo.sty}% + {\usepackage{mflogo}% + \def\FMF{\texttt{feyn}\textlogo{MF}}% + \def\EMP{\textlogo{EMP}}}% + {\def\MF{\textsf{META}\-\textsf{FONT}}% + \def\MP{\textsf{META}\-\textsf{POST}}% + \def\FMF{\texttt{feyn}\textsf{MF}}% + \def\EMP{\textsf{EMF}}} +% \end{macrocode} +% Protect against certain obsolete versions of the |graphics| package: +% \begin{macrocode} +\usepackage{graphics}[1994/12/15] +\usepackage{emp} +% \end{macrocode} +% \begin{macrocode} +\setlength{\parindent}{0pt} +\def\manindex#1{\SortIndex{#1}{#1}} +%\OnlyDescription +\EnableCrossrefs +\RecordChanges +\CodelineIndex +\DoNotIndex{\def,\gdef,\long,\let,\begin,\end,\if,\ifx,\else,\fi} +\DoNotIndex{\immediate,\write,\newwrite,\openout,\closeout,\typeout} +\DoNotIndex{\font,\jobname,\documentclass,\char,\catcode,\ } +\DoNotIndex{\CodelineIndex,\DocInput,\DoNotIndex,\EnableCrossrefs} +\DoNotIndex{\filedate,\filename,\fileversion,\logo,\manfnt} +\DoNotIndex{\NeedsTeXFormat,\ProvidesPackage,\RecordChanges,\space} +\DoNotIndex{\begingroup,\csname,\edef,\endcsname,\expandafter} +\DoNotIndex{\usepackage,\@ifundefined,\ignorespaces,\item,\leavevmode} +\DoNotIndex{\newcounter,\newif,\par,\parindent} +\DoNotIndex{\relax,\setcounter,\stepcounter,\the,\advance} +\DoNotIndex{\CurrentOption,\DeclareOption,\documentstyle} +\DoNotIndex{\endgroup,\global,\hfuzz,\LaTeX,\LaTeXe} +\DoNotIndex{\macrocode,\OnlyDescription,\PassOptionsToPackage} +\DoNotIndex{\ProcessOptions,\RequirePackage,\string,\textsf,\unitlength} +\DoNotIndex{\@bsphack,\@esphack,\@nameuse,\@ne,\active,\do,\dospecials} +\DoNotIndex{\errhelp,\errmessage,\ifcase,\IfFileExists,\includegraphics} +\DoNotIndex{\manindex,\SortIndex,\newcommand,\newtoks,\or,\origmacrocode} +\DoNotIndex{\alpha,\displaystyle,\frac,\sin,\texttt} +% \end{macrocode} +% Cut the line breaking some slack for macro code which might contain +% long lines (it doesn't really hurt if they stick out a bit). +% \begin{macrocode} +\let\origmacrocode\macrocode +\def\macrocode{\hfuzz 5em\origmacrocode} +\begin{document} + \DocInput{emp.dtx} +\end{document} +% +% \end{macrocode} +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput +Local Variables: +mode:LaTeX +fill-prefix:"% " +indent-tabs-mode:nil +change-log-default-name:"TODO" +page-delimiter:"^% %%%%%%%%%*\n" +End: diff --git a/macros/latex/contrib/emp/emp.ins b/macros/latex/contrib/emp/emp.ins new file mode 100644 index 0000000000..14ed75a8a7 --- /dev/null +++ b/macros/latex/contrib/emp/emp.ins @@ -0,0 +1,80 @@ +% emp.ins - Encapsulated MetaPost for LaTeX(2e) +% Copyright (C) 1997 by Thorsten.Ohl@Physik.TH-Darmstadt.de +% $Id: emp.ins,v 1.1 1997/06/14 20:50:59 ohl Exp $ +% +% Emp is free software; you can redistribute it and/or modify it +% under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 2, or (at your option) +% any later version. +% +% Emp 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 this program; if not, write to the Free Software +% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +\def\batchfile{emp.ins} +\input docstrip.tex +\keepsilent +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\preamble + +Copyright (C) 1997 by Thorsten.Ohl@Physik.TH-Darmstadt.de + +This file is NOT the source for emp, because almost all comments +have been stripped from it. It is NOT the preferred form of emp +for making modifications to it. + +Therefore you can NOT redistribute and/or modify THIS file. You can +however redistribute the complete source (emp.dtx and emp.ins) +and/or modify it under the terms of the GNU General Public License as +published by the Free Software Foundation; either version 2, or (at +your option) any later version. + +As a special exception, you can redistribute parts of this file for +the electronic distribution of scientific papers, provided that you +include a short note pointing to the complete source. + +Emp 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 this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +\endpreamble + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\Msg{Generating style file emp.sty for the emp package:} +\generateFile{emp.sty}{f}{\from{emp.dtx}{style}} +\Msg{Generating driver file for manual empman.drv:} +\generateFile{empman.drv}{f}{\from{emp.dtx}{driver,manual}} +\Msg{Generating driver file for documentation emp.drv:} +\generateFile{emp.drv}{f}{\from{emp.dtx}{driver}} + +\Msg{***************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the file} +\Msg{* emp.sty into a directory searched by TeX} +\Msg{*} +\Msg{* Optionally you can copy the file empman.dtx into a} +\Msg{* directory searched by TeX, so that users can print} +\Msg{* a copy of the documentation.} +\Msg{*} +\Msg{***************************************************************} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput +Local Variables: +mode:LaTeX +fill-prefix:"% " +page-delimiter:"^% %%%%%%%%%*\n" +End: diff --git a/macros/latex/contrib/emp/emp.pdf b/macros/latex/contrib/emp/emp.pdf new file mode 100644 index 0000000000..b27568776b Binary files /dev/null and b/macros/latex/contrib/emp/emp.pdf differ diff --git a/macros/latex/contrib/emp/empman.pdf b/macros/latex/contrib/emp/empman.pdf new file mode 100644 index 0000000000..3532e6c30d Binary files /dev/null and b/macros/latex/contrib/emp/empman.pdf differ -- cgit v1.2.3