summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/esk
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/esk
Initial commit
Diffstat (limited to 'macros/latex/contrib/esk')
-rw-r--r--macros/latex/contrib/esk/COPYING339
-rw-r--r--macros/latex/contrib/esk/Makefile192
-rw-r--r--macros/latex/contrib/esk/README45
-rw-r--r--macros/latex/contrib/esk/esk.dtx1137
-rw-r--r--macros/latex/contrib/esk/esk.ins84
-rw-r--r--macros/latex/contrib/esk/esk.pdfbin0 -> 166697 bytes
-rw-r--r--macros/latex/contrib/esk/eskman.pdfbin0 -> 285842 bytes
7 files changed, 1797 insertions, 0 deletions
diff --git a/macros/latex/contrib/esk/COPYING b/macros/latex/contrib/esk/COPYING
new file mode 100644
index 0000000000..e77696ae8d
--- /dev/null
+++ b/macros/latex/contrib/esk/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.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ 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.
+
+ <signature of Ty Coon>, 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/esk/Makefile b/macros/latex/contrib/esk/Makefile
new file mode 100644
index 0000000000..7f045d30ad
--- /dev/null
+++ b/macros/latex/contrib/esk/Makefile
@@ -0,0 +1,192 @@
+# Makefile :-- install esk.
+# Copyright (C) 2010 Tom Kazimiers (tom AT voodoo-arts.net)
+# Based on the Makefile of emp latex package by Thorsten Ohl
+# (Thorsten.Ohl@Physik.TH-Darmstadt.de)
+#
+# Esk 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.
+#
+# Esk 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.0 2010/02/25 21:14:41 kazimiers Exp $
+#
+########################################################################
+
+VERSION = 1
+RELEASE = 0
+STATUS = WIP
+
+########################################################################
+
+# Directories
+prefix = $(HOME)
+texdir = $(prefix)/texmf/inputs
+docdir = $(texdir)/doc
+
+# Commands
+INSTALL = install -c -m 755
+INSTALL_DATA = install -c -m 644
+# INSTALL = cp
+# INSTALL_DATA = cp
+
+LATEX = latex
+SK = sketch
+MAKEINDEX = makeindex
+DVIPS = dvips
+DFLAGS =
+FILES="*.sk"
+
+########################################################################
+# 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: esk.sty esk.drv
+
+man: eskman.ps
+
+ps: esk.ps
+
+dvi: esk.dvi
+
+install: all
+ $(INSTALL_DATA) esk.sty $(texdir)
+
+install.doc: all
+ $(INSTALL_DATA) esk.dtx $(docdir)
+ $(INSTALL_DATA) esk.drv $(docdir)
+ $(INSTALL_DATA) eskman.drv $(docdir)
+
+uninstall:
+ rm -f $(texdir)/esk.sty
+
+uninstall.doc:
+ rm -f $(docdir)/esk.dtx
+ rm -f $(docdir)/esk.drv
+ rm -f $(docdir)/eskman.drv
+
+esk.sty: esk.dtx esk.ins
+ $(LATEX) esk.ins
+
+esk.drv eskman.drv: esk.sty
+
+esk.dvi: esk.dtx esk.drv esk.sty
+ -$(LATEX) $*.drv
+ for i in `ls *.sk`; do \
+ ($(SK) -o "$$i.tex" "$$i" && \
+ cut -d "%" -f1 <"$$i.tex" >"$$i.tex.tmp" && \
+ rm "$$i.tex" && \
+ mv "$$i.tex.tmp" "$$i.tex") \
+ done
+ -$(LATEX) $*.drv
+ $(RUN_MAKEINDEX)
+ $(RESOLVE_XREF)
+
+eskman.ps: eskman.dvi
+ dvips eskman.dvi -o
+
+eskman.dvi: esk.dtx eskman.drv esk.sty
+ -$(LATEX) $*.drv
+ # call sketch, e. g. convert the sketch code to tex
+ # unfortunately Sketch produces comments, that is a
+ # problem because DTX is used and a single % sign
+ # there has a meaning. Thus substitude each % sign
+ # with a %% sign:
+ for i in `ls *.sk`; do \
+ ($(SK) -o "$$i.tex" "$$i" && \
+ cut -d "%" -f1 <"$$i.tex" >"$$i.tex.tmp" && \
+ rm "$$i.tex" && \
+ mv "$$i.tex.tmp" "$$i.tex") \
+ done
+ -$(LATEX) $*.drv
+ pdflatex $*.drv
+ $(RUN_MAKEINDEX)
+ $(RESOLVE_XREF)
+
+manual.ps.gz: manual.ps
+ gzip < $< > $@
+
+manual.ps: eskman.dvi $(MANPICS)
+ $(DVIPS) $(DFLAGS) -o $@ $<
+
+esk.ps: esk.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 esk.sty esk.drv eskman*
+
+distclean: realclean
+
+########################################################################
+# Maintenance:
+
+DISTFILES = /usr/local/etc/COPYING README Makefile esk.dtx esk.ins
+
+distdir = esk-$(VERSION).$(RELEASE)$(STATUS)
+CVSTAG = ESK_$(VERSION)_$(RELEASE)$(STATUS)
+TEXTAG = v$(VERSION).$(RELEASE)
+M =
+
+fileversion:
+ perl -pe \
+ 's/^\\def\\fileversion\{.*\}/\\def\\fileversion{$(TEXTAG)}/;' \
+ esk.dtx > esk.vtmp
+ if cmp -s esk.dtx esk.vtmp; then \
+ rm -f esk.vtmp; \
+ else \
+ mv esk.vtmp esk.dtx; \
+ fi
+
+dist: $(distdir).tar.gz
+snap: esk-current.tar.gz
+
+$(distdir).tar.gz:
+ rm -fr $(distdir) $(distdir).tmp
+ mkdir $(distdir)
+ (cd ./$(distdir).tmp && \
+ make $(DISTFILES) && \
+ cp $(DISTFILES) ../$(distdir))
+ tar cf - $(distdir) | gzip > $@
+ rm -fr $(distdir) $(distdir).tmp
+
+esk-current.tar.gz: $(DISTFILES) fileversion
+ rm -fr esk-current
+ mkdir esk-current
+ touch esk-current/1_THIS_IS_A_SNAPSHOT_OF_
+ touch esk-current/2_WORK_IN_PROGRESS_AND__
+ touch esk-current/3_NOT_YET_RELEASED_CODE_
+ cp $(DISTFILES) esk-current
+# perl -pe \
+# 's/\[\\filedate/[(UNRELEASED and UNSUPPORTED snapshot)/;' \
+ esk.dtx > esk-current/esk.dtx
+ tar cf - esk-current | gzip > $@
+ rm -fr esk-current
+
+########################################################################
+# Local Variables:
+# mode:text
+# End:
diff --git a/macros/latex/contrib/esk/README b/macros/latex/contrib/esk/README
new file mode 100644
index 0000000000..d689f0291b
--- /dev/null
+++ b/macros/latex/contrib/esk/README
@@ -0,0 +1,45 @@
+# README,v 1.0, 2010/05/04 14:00:24, Tom Kazimiers
+########################################################################
+
+ This is esk, a package for encapsulated Sketch 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 Sketch 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. This package itself used emp by Thorstes Ohl
+ as a starting point.
+
+ Enjoy,
+ -Tom
+
+########################################################################
+
+ Comments, bug reports and improvements are welcome at:
+
+ tom@voodoo-arts.net
+
+ New versions can be found in:
+
+ voodoo-arts.net/pub/tex/esk
+
+########################################################################
+
+NEWS for Version 1.0
+
+ * First version released
+
+########################################################################
+
+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/esk/esk.dtx b/macros/latex/contrib/esk/esk.dtx
new file mode 100644
index 0000000000..284d356ada
--- /dev/null
+++ b/macros/latex/contrib/esk/esk.dtx
@@ -0,0 +1,1137 @@
+% \iffalse meta-comment
+%
+% esk.dtx - Encapsulated MetaPost for LaTeX(2e)
+%
+% Copyright (C) 2010 by Tom Kazimiers (tom@voodoo-arts.net)
+%
+% Esk 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.
+%
+% Esk 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.
+%
+% This project is greatly inspired and based on EMP. EMP is a LaTeX
+% package to provide a convenient way to work with metapost files and
+% code from inside LaTeX documents.
+%
+% \fi
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% \CheckSum{397}
+%% \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{%
+% \ESK: \\
+% Encapsulated \SK{} for \LaTeX\thanks{%
+% This is \texttt{\filename}, version \fileversion,
+% revision \filerevision, date \filedate.}}
+%
+% \author{%
+% Tom Kazimiers\thanks{e-mail:
+% \texttt{tom@voodoo-arts.net}}}
+%
+% \maketitle
+% \begin{abstract}
+% The \ESK{} package allows to encapsulate \SK{} 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 \LaTeX{} files that fit into the confines of file
+% system conventions.
+% \end{abstract}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \vfill
+% \section*{Copying}
+%
+% \ESK{} 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.
+%
+% \ESK{} 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}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \section{Introduction}
+%
+% When adding illustrations to documents, one faces two bookkeeping
+% problems:
+% \begin{itemize}
+% \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{itemize}
+% For both problems, the best solution is to encapsulate the figures
+% in the \LaTeX{} source:
+% \begin{itemize}
+% \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{itemize}
+% Therefore \ESK{} was written to allow to encapsulate
+% \SK{}~\cite{Sketch} into \LaTeX~\cite{LaTeX,Knuth}. It is based on
+% \texttt{emp}~\cite{emp} since it follows a similar approach for \MP{}
+% \cite{MP}.
+% Nevertheless, it is arguable that complex \SK{} figures may be easier
+% handled in a separate file. That is because it does not directly
+% improve readability for ones source code to have the \SK{} code mixed
+% with \LaTeX. But that's purely a matter of taste and complexity. To
+% have \SK{} code in separate files be included in your build process
+% you could do the following:
+% \begin{enumerate}
+% \item have your \SK{} code in a file, e.g. \emph{nice\_scene.sk}
+% \item include the file \emph{nice\_scene.sk.tex} in your document
+% source
+% \item configure your build in a way to automatically call \SK{} on all
+% \emph{\textasteriskcentered.sk} files, e.g in a Makefile:\newline
+% { |for i in `ls *.sk`; do sketch -o "$$i.tex" "$$i"; done| }
+% \end{enumerate}
+% At least for less complex graphics it is more convenient to use \ESK{}
+% and thus stay consistent more easily.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \section{Usage}
+%
+% This chapter describes the different macros and environments provided
+% by the \ESK{} package. The |esk| environment is the one that actually
+% generates printable source code. Depending on what options have been
+% specified with |\eskglobals| and |\eskaddtoglobals| this is TikZ or
+% PSTricks code. If an |esk| environment is encountered, it gets
+% processed the following way:
+% \begin{enumerate}
+% \item \label{proc:gen_name}Create a file name for the current figure
+% out of the base name and a running figure number:
+% $\langle$\textit{name}$\rangle$.$\langle$\textit{number}$\rangle$.sk
+% (E. g. pyramid.1.sk)
+% \item \begin{enumerate}
+% \item \label{proc:tex_file_found} If a file exists that is named
+% like written in \ref{proc:gen_name} but with an additional
+% \textit{.tex} at the end (e.g. pyramid.1.sk.tex) it is
+% treated as a \SK{} processed result file. Thus, it is
+% included as a replacement for the environments content.
+% \item If such an item as in \ref{proc:tex_file_found} is not found
+% a \SK{} file with the contents of the environment is saved
+% to a file with the name generated in \ref{proc:gen_name}.
+% \end{enumerate}
+% \end{enumerate}
+% In contrast to \MP{} \SK{} can't produce different output files out of
+% one source file. This means every \SK{} figure has to be put into its
+% own \SK{} file. As a consequence one has to process all generated \SK
+% files with \SK and one can not have one generated file for the whole
+% document. A possible way of managing the build (within a Makefile) of
+% a document then could be:
+% \begin{enumerate}
+% \item Call |latex| on the document source
+% \item Process all \SK{} files and stick to naming convention:\newline
+% { |for i in `ls *.sk`; do sketch -o "$$i.tex" "$$i"; done| }
+% \item Call either |latex| and |dvips| or |pdflatex| on the document
+% source to actually see TikZ or PSTricks figures.
+% \end{enumerate}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{Commands and Environments}
+% \label{sec:commands}
+%
+% \DescribeEnv{esk}
+% The |esk| environment contains the description of a single
+% figure that will be placed at the location of the environment.
+% The macro has two optional arguments. The first is the name of
+% the figure and defaults to |\jobname|. It is used as the base
+% name for file names. The second one consists of a comma separated
+% list of names previously defined with |\eskdef|. Note that the
+% names have to be put in parentheses (not brackets or braces).
+% Those definitions will be prepended to the \SK-commands.
+% \begin{quote}
+% \begin{flushleft}
+% |\begin{esk}[|\meta{name}|](|\meta{def 1}|,|\meta{def 2}|,...)|\\
+% \qquad\meta{\SK-commands}\\
+% |\end{esk}|
+% \end{flushleft}
+% \end{quote}
+%
+% \DescribeEnv{eskdef}
+% The |eskdef| environment acts as a container for \SK-commands.
+% In contrast to |esk| nothing is written to a file or drawn, but
+% kept in a token list register to recall it later on. Thus,
+% reoccurring patterns can be factored out and used as argument
+% in an |esk| environment. This is useful, because these
+% environments use the |verbatim| package and can therefore
+% \emph{not} be used directly as an argument to other macros.
+% \begin{quote}
+% \begin{flushleft}
+% |\begin{eskdef}{|\meta{name}|}|\\
+% \qquad\meta{\SK-commands}\\
+% |\end{eskdef}|
+% \end{flushleft}
+% \end{quote}
+%
+% \DescribeMacro{\eskprelude}
+% Define a \SK{} prelude to be written to the top of every \SK{}
+% file. The default is an empty prelude. Keep in mind that verbatim
+% arguments are not allowed.
+%
+% \DescribeMacro{\eskaddtoprelude}
+% Add to the \SK{} prelude.
+% E. g.~|\eskaddtoprelude{def O (0,0,0)}| makes sure the variable O
+% is available in all |esk| environments (and thus in every generated
+% \SK{} file). Of cause, this could also be achieved with |Eskimo|.
+%
+% \DescribeMacro{\eskglobals}
+% Define global \SK{} properties that get passed to the |global {...}|
+% method of \SK. This defaults to |language tikz|.
+%
+% \DescribeMacro{\eskaddtoglobals}
+% Add something to the global parameters of \SK.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{Examples}
+% \label{sec:examples}
+%
+% For a simple example, let's draw a pyramid in a coordinate
+% system. Since our scene should be a composition of coordinate
+% axes and the geometry, we prepare definitions for the single
+% parts. In that way the parts will be reusable. First the
+% coordinate system:
+% \begin{macrocode}
+%<*sample>
+\begin{eskdef}{axes}
+ def three_axes {
+ % draw the axes
+ def ax (dx,0,0)
+ def ay (0,dy,0)
+ def az (0,0,dz)
+ line[arrows=<->,line width=.4pt](ax)(O)(ay)
+ line[arrows=->,line width=.4pt](O)(az)
+ % annotate axes
+ special |\path #1 node[left] {$z$}
+ #2 node[below] {$x$}
+ #3 node[above] {$y$};|(az)(ax)(ay)
+ }
+\end{eskdef}
+% \end{macrocode}
+%\begin{eskdef}{axes}
+ def three_axes {
+ % draw the axes
+ def ax (dx,0,0)
+ def ay (0,dy,0)
+ def az (0,0,dz)
+ line[arrows=<->,line width=.4pt](ax)(O)(ay)
+ line[arrows=->,line width=.4pt](O)(az)
+ % annotate axes
+ special |\path #1 node[left] {$z$}
+ #2 node[below] {$x$}
+ #3 node[above] {$y$};|(az)(ax)(ay)
+ }
+%\end{eskdef}
+% Now the pyramid:
+% \begin{macrocode}
+\begin{eskdef}{pyramid}
+ def pyramid {
+ def p0 (0,2)
+ def p1 (1.5,0)
+ def N 4
+ def seg_rot rotate(360 / N, [J])
+ % draw the pyramid by rotating a line about the J axis
+ sweep[fill=red!20, fill opacity=0.5] { N<>, [[seg_rot]] }
+ line[cull=false,fill=blue!20,fill opacity=0.5](p0)(p1)
+ }
+\end{eskdef}
+% \end{macrocode}
+%\begin{eskdef}{pyramid}
+ def pyramid {
+ def p0 (0,2)
+ def p1 (1.5,0)
+ def N 4
+ def seg_rot rotate(360 / N, [J])
+ % draw the pyramid by rotating a line about the J axis
+ sweep[fill=red!20, fill opacity=0.5] { N<>, [[seg_rot]] }
+ line[cull=false,fill=blue!20,fill opacity=0.5](p0)(p1)
+ }
+%\end{eskdef}
+% In the definitions some variable have been used that have
+% not been declared so far (|O|, |dx|, |dy|, |dz|, |J|). They have
+% been introduced to make the definitions more versatile. In
+% order to draw the scene their declaration has to be prepended
+% to our output:
+% \begin{macrocode}
+\eskaddtoprelude{def O (0,0,0)}
+\eskaddtoprelude{def dx 2.3}
+\eskaddtoprelude{def dy 2.5}
+\eskaddtoprelude{def dz dx}
+\eskaddtoprelude{def J [0,1,0]}
+% \end{macrocode}
+%\eskaddtoprelude{def O (0,0,0)}
+%\eskaddtoprelude{def dx 2.3}
+%\eskaddtoprelude{def dy 2.5}
+%\eskaddtoprelude{def dz dx}
+%\eskaddtoprelude{def J [0,1,0]}
+%
+% Now the previously created definitions can be used to do the
+% actual drawing. First, the coordinate system on its own:
+%\begin{center}
+%\begin{esk}(axes)
+ def scene {
+ {three_axes}
+ }
+ put { view((10,4,2)) } {scene}
+%\end{esk}
+%\end{center}
+% \begin{macrocode}
+\begin{esk}(axes)
+ def scene {
+ {three_axes}
+ }
+ put { view((10,4,2)) } {scene}
+\end{esk}
+% \end{macrocode}
+% Now the pyramid (note, the transparency effect will only be
+% visible in a pdf):
+%\begin{center}
+%\begin{esk}(pyramid)
+ def scene {
+ {pyramid}
+ }
+ put { view((10,4,2)) } {scene}
+%\end{esk}
+%\end{center}
+% \begin{macrocode}
+\begin{esk}(pyramid)
+ def scene {
+ {pyramid}
+ }
+ put { view((10,4,2)) } {scene}
+\end{esk}
+% \end{macrocode}
+% Finally both:
+%\begin{center}
+%\begin{esk}(axes,pyramid)
+ def scene {
+ {three_axes}
+ {pyramid}
+ }
+ put { view((10,4,2)) } {scene}
+%\end{esk}
+%\end{center}
+% \begin{macrocode}
+\begin{esk}(axes,pyramid)
+ def scene {
+ {pyramid}
+ {three_axes}
+ }
+ put { view((10,4,2)) } {scene}
+\end{esk}
+%</sample>
+% \end{macrocode}
+% With permission of Kjell Magne Fauske, the source code for this
+% example scene has been taken from \cite{Fauske}.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \begin{thebibliography}{99}
+% \bibitem{Sketch} Eugene K. Ressler, Sketch, 2010/04/24,
+% http://www.frontiernet.net/~eugene.ressler/
+% \bibitem{LaTeX} Leslie Lamport, \textit{\LaTeX{} --- A
+% Documentation Preparation System},
+% Addison-Wesley, Reading MA, 1985.
+% \bibitem{Knuth} Donald E. Knuth, \textit{The \TeX book},
+% Addison-Wesley, 1996
+% \bibitem{emp} Thorsten Ohl, \texttt{emp},Encapsulated MetaPost,
+% 1997, available from CTAN
+% \bibitem{MP} John D.~Hobby, \textit{A User's Manual for
+% \MP}, Computer Science Report \#162, AT\&T Bell
+% Laboratories, April 1992.
+% \bibitem{Fauske} Kjell Magnus Fauske, An introduction to Sketch,
+% 2010/04/24, http://www.fauskes.net/nb/introduction-to-sketch/
+% \end{thebibliography}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \section*{Distribution}
+% \label{sec:distribution}
+%
+% \ESK{} 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/esk|
+% \end{quote}
+% It is available from host
+% \begin{quote}
+% |www.voodoo-arts.net|
+% \end{quote}
+% in the directory
+% \begin{quote}
+% |pub/tex/esk|
+% \end{quote}
+% A work in progress under git control is available from
+% \begin{quote}
+% |http://github.com/tomka/esk|
+% \end{quote}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \StopEventually{\PrintIndex\PrintChanges}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \section{Implementation}
+% \changes{v1.0}{2010/05/05}{Version 1.0 Release}
+%
+% This project is greatly inspired and based on EMP. EMP is a LaTeX package
+% to provide a convenient way to work with metapost files and code from
+% inside LaTeX documents.
+%
+% \iffalse meta-comment
+%% TeX hints:
+%% - @ is considered a normal letter in packages and classes
+%% - There are 256 32Bit \count<num> registers (i.e. \count0=42),
+%% can be expanded with \the<register> (i.e. \the\count0)
+%% - \relax ends scanning for tokens
+%% (i.e. \count0=\macro 42 <> \count0=\macro\relax 42)
+%% - A macro defined with can has a maximum of 9 arguments
+%% - \gdef is shortcut for \global\def
+%% \xdef is shortcut for \global\edef
+%% - \string<\macro> returns the "macro" (the name of a macro)
+%% Doc hints:
+%% - There must be _exactly_ four spaces between the "%" and the
+%% "\begin{macrocode}" or "\end{macrocode}. Otherwise, Doc
+%% won't detect the end of the code fragment.
+%% - The lines of code withen \begin{macrocode}...\end{macrocode}
+%% get written exactly as is to the .ins file, with no %-stripping.
+% \fi
+%
+% 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. The parsing macro
+% is only visible locally (within the surrounding scope), but generated
+% control sequences like |\filename| are defined globally (due to the
+% use of |\gdef|):
+% \begin{macrocode}
+%<*style>
+\def\fileversion{v1.0}
+{\def\RCS#1#2\endRCS{%
+ % is the first parameter a "$%?
+ \ifx$#1%
+ \@RCS $#2 \endRCS
+ \else
+ \@RCS $*: #1#2$ \endRCS
+ \fi}%
+ \def\@RCS $#1: #2,v #3 #4 #5 #6 #7$ \endRCS{%
+ % global defines (independent of current scope) of file attributes
+ \gdef\filename{#2}%
+ \gdef\filerevision{#3}%
+ \gdef\filedate{#4}%
+ \gdef\filemaintainer{#6}}%
+\RCS $Id: esk.dtx,v 1.0 2010/05/05 01:23:42 kazimiers Exp $ \endRCS}%
+% \end{macrocode}
+% Make clear what LaTeX version is needed:
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+% \end{macrocode}
+% And now the standard procedure:
+% \begin{macrocode}
+\ProvidesPackage{esk}[\filedate\space\fileversion\space
+ Encapsulated Sketch LaTeX Package (\filemaintainer)]
+% \end{macrocode}
+% We do not declare options for this package, so we do not need to
+% invoke processing for found ones. Some other packages needed by
+% \ESK{}, partly of a minimum version, get specified.
+% \begin{macrocode}
+\RequirePackage{verbatim}
+\RequirePackage{kvsetkeys}[2007/09/29]
+% \end{macrocode}
+% The characters "\%", "\{" and "\}" are somewhat special to \TeX. More
+% precisely are they used for comments and grouping respectively. \SK{}
+% uses them as well, for the same purposes. To allow convenient code
+% generation by using macros to produce the symbols, three macros get
+% defined:
+% \begin{macro}{\p@rcent}
+% That macro is used for creating comments. The \% sign is locally
+% defined as a common letter (category code 11) and create a global macro
+% using it. The |@| in the name of the control sequence makes it only visible
+% from inside the
+% package\footnote{see http://de.wikibooks.org/wiki/LaTeX-Wörterbuch:\_\@}.
+% \begin{macrocode}
+{\catcode`\%=11\gdef\p@rcent{%}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lc@rly}
+% \begin{macro}{\rc@rly}
+% Curly braces are used for scope and group definitions in \SK. Just like
+% with the |\p@rcent| macro, we need to make them a common letter.
+% Unfortunately we need the curly braces to define a local scope for \TeX.
+% To come around this the characters $>$ and $<$ are locally defined to
+% be grouping characters (category code 1). To allow normal scope closing
+% we finally make the curly braces grouping characters again.
+% \begin{macrocode}
+{\catcode`\>=1 \catcode`\<=2
+ \catcode`\{=11 \catcode`\}=11
+ \gdef\lc@rly>{<
+ \gdef\rc@rly>}<
+ \catcode`\{=1 \catcode`\}=2
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\eskwrite}
+% Define a macro to write the contents of its first argument to a file.
+% If the Boolean toggle |@eskio| is set to true, the passed argument is
+% written\footnote{see http://www.tug.org/utilities/plain/cseq.html\#write-rp}
+% out to the file referenced in |@outesk|. Normally \TeX{} does the
+% actual writing during a |\shipout| operation, but we force it to do it
+% immediately\footnote{see http://www.tug.org/utilities/plain/cseq.html\#immediate-rp}.
+% All directly following spaces on the input will be
+% eaten\footnote{see http://en.wikibooks.org/wiki/TeX/ignorespaces}.
+% \begin{macrocode}
+\def\eskwrite#1{%
+ \if@eskio
+ \immediate\write\@outesk{#1}%
+ \fi
+ \ignorespaces}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\eskwritetoken}
+% If a token list register should be put into a file, this macro should
+% be used. It will expand the token variable to its current contents.
+% \begin{macrocode}
+\def\eskwritetoken#1{
+ \eskwrite{\the#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% Next a new private Boolean toggle is defined. It is used to reflect if
+% file writing is enabled and set it to true.
+% \begin{macrocode}
+\newif\if@eskio
+\@eskiotrue
+% \end{macrocode}
+%
+% The next free output file handle will be referenced by the private macro
+% |\@outesk|. At this point no file is opened, but just an output channel
+% defined\footnote{see \textit{A TEX primer for scientists} by Stanley
+% A. Sawyer,Steven George Krantz on p. 283}. An example file open could now
+% look like: |\openout\@outesk=TEXTFILE.TXT|.
+% \begin{macrocode}
+\newwrite\@outesk
+% \end{macrocode}
+%
+% \begin{macro}{\eskfile}
+% This environment encloses each \SK{} input file. The single optional
+% argument gives the name of the file and defaults to |\jobname|. This will
+% probably not be used explicitly when defining esk figures. It is invoked
+% automatically with an appropriate name for a figure. The macro |\theeskfile|
+% gets locally defined and stores the base name for a file.
+% \begin{macrocode}
+\newcommand{\eskfile}[1][\jobname]{%
+ \def\theeskfile{#1}%
+% \end{macrocode}
+% Open the Sketch file. If output is enabled, check if we're running under
+% AMS-\LaTeX{} and if that is the case turn off I/O during the first pass over
+% equation environments. This is done by looking for |\ifmeasuring@| of
+% AMS-\LaTeX{} and, if found, replacing all |\if@eskio| checks with it.
+% \begin{macrocode}
+ \if@eskio
+ \@ifundefined{ifmeasuring@}%
+ {}%
+ {\def\if@eskio{\ifmeasuring@\else}}%
+% \end{macrocode}
+% A a new output file is linked to our |\@outesk| file number. The name of that
+% file is the content of |\theeskfile| with extension \textit{.sk}. Afterwards
+% a start comment is written to the new file.
+% \begin{macrocode}
+ \immediate\openout\@outesk=\theeskfile.sk\relax
+ \eskwrite{\p@rcent\p@rcent\p@rcent\space \theeskfile.sk -- %
+ do not edit, generated automatically by \jobname.tex}%
+% \end{macrocode}
+% The |esk@prelude| token list register stores a prelude that should be put at
+% the beginning of the new file. If the register is empty, the expansion of it
+% (|\the\esk@prelude|) will be empty. This means the |\ifx| condition is met,
+% because the actual check is now if |*| equals |*|. Hence the |\else| branch
+% will \emph{not} be called. If the token register is not empty (and does not
+% start with an asterisk) the |\else| branch is used..
+% \begin{macrocode}
+ \expandafter\ifx\expandafter*\the\esk@prelude*\else
+ \eskwrite{\the\esk@prelude}%
+ \fi
+ \fi}
+% \end{macrocode}
+%
+% Define |\theeskfile|, later redefined with the name of the currently opened
+% file, to be |\relax| (i.e. stop reading tokens). This should be the value
+% if no file is opened.
+% \begin{macrocode}
+\let\theeskfile\relax
+% \end{macrocode}
+% Define a new counter |\eskfig| to count the single esk figures. It is
+% initialized with 0.
+% \begin{macrocode}
+\newcounter{eskfig}
+% \end{macrocode}
+%
+% Let \TeX{} create a new token list register alias |\esk@prelude|. It stores
+% an optional prelude for the files written out. If the indirect alias
+% creation |\newtoks| is used, \TeX{} selects a free register and hides the
+% technical detail from us.
+% \begin{macrocode}
+\newtoks\esk@prelude
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\eskprelude}
+% \begin{macro}{\eskaddtoprelude}
+% Define a public |\eskprelude| macro that replaces the contents of the
+% internal token list register |\esk@prelude| with the argument passed.
+% \begin{macrocode}
+\def\eskprelude#1{\esk@prelude={#1}}
+% \end{macrocode}
+% Define a public macro that appends its argument to the internal
+% |\esk@prelude| token list register. The text is added on a new line.
+% This is accomplished by using |^^J|, a replacement ASCII representation
+% for LF (line feed)\footnote{e.g. see: http://www.torsten-horn.de/techdocs/ascii.htm}.
+% \begin{macrocode}
+\def\eskaddtoprelude#1{\esk@prelude=\expandafter{\the\esk@prelude^^J#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The token list register storing the global settings of \SK{} is called
+% |\esk@globals| and defaults to \emph{language tikz}.
+% \begin{macrocode}
+\newtoks\esk@globals
+\esk@globals={language tikz}
+% \end{macrocode}
+%
+% \begin{macro}{\eskglobals}
+% \begin{macro}{\eskaddtoglobals}
+% The macros |\eskglobals| and |\eskaddtoglobals| are there to set and
+% modify the private token list register |\esk@globals|. With them one
+% has control over the general settings of \SK. On adding, new settings
+% will be delimited by a comma.
+% \begin{macrocode}
+\def\eskglobals#1{\esk@globals={#1}}
+\def\eskaddtoglobals#1{\esk@globals=\expandafter{\the\esk@globals,#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\endeskfile}
+% And here is how the |empfile| environment is closed. If there are
+% global settings they are written out. The last line of the generated
+% file will be an end statement in form of a comment. followed by a line
+% break. As a convention the macro keeping the base name of the file,
+% |\theeskfile|, is set to |\relax|. That indicates that no file is open.
+% To make that true, the currently opened file (if any) is finally
+% closed.
+% \begin{macrocode}
+\def\endeskfile{%
+ \expandafter\ifx\expandafter*\the\esk@globals*\else
+ \eskwrite{global \lc@rly\the\esk@globals\rc@rly }%
+ \fi
+ \eskwrite{\p@rcent\p@rcent\p@rcent\space the end.^^J}%
+ \let\theeskfile\relax
+ \if@eskio
+ \immediate\closeout\@outesk
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\esk}
+% The |esk| environment encloses \SK{} code that will be put into a file
+% for being later processed by \SK. First it (re-)defines the macro
+% |\esk@@name| with the environments argument. That argument is used as
+% the base name for the corresponding file and defaults to |\jobname|.
+% Then the internal macro |\esk@| produces a single esk graphic.
+% \begin{macrocode}
+\newcommand{\esk}[1][\jobname]{%
+ \def\esk@@name{#1}%
+ \esk@}
+% \end{macrocode}
+% \end{macro}
+%
+% Since the |esk| environment allows two optional parameters and only
+% one can have brackets, the second parameter is surrounded by parentheses.
+% A macro for an opening parenthesis is defined:
+% \begin{macrocode}
+\let\leftparanthesis=(
+% \end{macrocode}
+%
+% \begin{macro}{\esk@}
+% The private |\esk@| macro stores the immediately following token in
+% the macro |\next| and invokes |\esk@impl|.
+% \begin{macrocode}
+\def\esk@{
+ \futurelet\next\esk@impl}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\esk@impl}
+% Now that the following token is known in |\next| it is checked
+% if the second optional argument got passed. This is done by testing
+% if the next token is an opening parenthesis and depending on its
+% occurrence |\esk@impl@Arg| or |\esk@impl@NoArg| is invoked. Since
+% we want to work with the content of the environment verbatim, we
+% have to get rid of |\else| and |\fi| in the input stream. This
+% can be achieved by just expanding them before calling the verbatim
+% handling macros with |\expandafter|.
+% \begin{macrocode}
+\def\esk@impl{%
+ \ifx\next\leftparanthesis
+ \expandafter\esk@impl@Arg
+ \else
+ \expandafter\esk@impl@NoArg
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\esk@impl@NoArg}
+% \begin{macro}{\esk@impl@Arg}
+% The macro |\esk@impl@NoArg| just calls |\esk@impl@Arg| with an
+% empty argument. It is mainly there for readability.
+% \begin{macrocode}
+\def\esk@impl@NoArg{\esk@impl@Arg()}
+% \end{macrocode}
+% The following macro, |\esk@impl@Arg|, expects one argument
+% surrounded by parentheses, namely a list of |eskdef| names.
+% It makes sure some preconditions are met by invoking |\esk@start|.
+% Afterwards |\esk@includegraphics| checks if a \SK{} file should
+% be generated or a \LaTeX{} file be included. Finally the argument
+% is parsed as a comma separated list to call |\esk@def@processor|
+% for each element found and the actual \SK{} code verbatim
+% processing is started with |\esk@cmds|. As the verbatim line
+% processing macro name "eskwritetoken" is passed as an argument.
+% \begin{macrocode}
+\def\esk@impl@Arg(#1){%
+ \esk@start%
+ \esk@includegraphics{\theeskfile}%
+ \comma@parse{#1}{\esk@def@processor}%
+ \esk@cmds{eskwritetoken}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{esk@def@processor}
+% The macro |\esk@def@processor| gets expanded for every element
+% of the second optional argument of the |esk| environment. Here
+% every |eskdef| name of that list will be included in the current
+% file by invoking |\eskuse| for it.
+% \begin{macrocode}
+\def\esk@def@processor#1{
+ \esk@use{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\esk@start}
+% A macro for preparing for a new \SK{} figure.
+% \begin{macrocode}
+\def\esk@start{%
+% \end{macrocode}
+% We can't use |\stepcounter| because of the |amstext| option of
+% AMS-\LaTeX{} disables it sometimes. Instead we globally advance
+% the eskfig counter manually by one. Afterwards we call
+% |\esk@checkfile| to make sure a file is open. Finally we invoke
+% |\esk@@def| with our previously defined temporary esk file name
+% to generate new |\theeskfile| and |\theeskfig| alias macros for
+% the current figure.
+% \begin{macrocode}
+ \global\expandafter\advance\csname c@eskfig\endcsname \@ne
+ \esk@checkfile
+ \esk@@def{\esk@@name}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\esk@checkfile}
+% Make sure that a Sketch file is open, otherwise \emph{really}
+% obscure error messages are possible. This is done by checking
+% if |\theeskfile| is the same as |\relax| (as defined during
+% initialization and file closing). If so, try to open a file
+% (again) and do the test again. If it still fails print and
+% produce an error.
+% \begin{macrocode}
+\def\esk@checkfile{%
+ \ifx\theeskfile\relax
+ \eskfile[\esk@@name.\arabic{eskfig}]
+ \fi
+ \ifx\theeskfile\relax
+ \errmessage{Could not open file "\esk@@name.\arabic{eskfig}.sk"!}
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\esk@includegraphics}
+% If a file having \emph{.sk.tex} added to the base name exists
+% this macro will include it. To start a new paragraph if we are
+% in vertical mode and switch to horizontal mode |\leaveemode|
+% is called at the beginning. Then, if the file exists, pass its
+% name as an argument to |\input| (which expects the file to end
+% with \emph{.tex}). If there is no such file a message is typed
+% out to tell the user that the sketch files might need the actual
+% processing.
+% \begin{macrocode}
+\def\esk@includegraphics#1{%
+ \leavevmode
+ \IfFileExists{#1.sk.tex}%
+ {\input{#1.sk.tex}}%
+ {\typeout{%
+ esk: File #1.sk.tex\space not found:^^J%
+ esk: Process #1.sk with Sketch (-o #1.sk.tex) and then %
+ reprocess this file.}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\esk@cmds}
+% The macro |\esk@cmds| gets the |esk| environments content by
+% using the verbatim package. Each line is processed by a macro
+% which name is passed as an argument. That is done to reuse
+% the macro for |esk| and |eskdef| environments. The macros
+% in use for the line processing are |eskwrite| and
+% |esk@def@verb@proc| respectively. Due to the use of
+% |\begingroup| \TeX{} enters a group that has to be terminated
+% by |\endgroup| and not by \}.
+% \begin{macrocode}
+\newcommand{\esk@cmds}[1]{%
+ \begingroup
+% \end{macrocode}
+% The macros |\@bsphack| ... |\@esphack| are used by macros such as
+% |\index| and |\begin{@float}| ... |\end{@float}| that want to be
+% invisible -- i.e. not leave any extra space when used in the
+% middle of text. Such a macro should begin with |\@bsphack| and
+% end with |\@esphack|. The macro in question should not create any
+% text, nor change the mode.
+% \begin{macrocode}
+ \@bsphack
+% \end{macrocode}
+% The next thing to do is to defuse \LaTeX{}' special characters:
+% |\dospeciels| expands to a list of special characters of the form
+% |\do\ \do\\ \do\{ \do\}|.... If one (re-)defines the "|\do|" macro
+% one can execute a macro on all of them. In our case we define
+% |\do| to be |\@makeother|. That assigns category code 12
+% (non-letter) to all special characters, thus they get normal
+% characters without any special meaning. Due to the environment
+% those changes are local.
+% \begin{macrocode}
+ \let\do\@makeother\dospecials
+% \end{macrocode}
+% |^^M| is the ASCII representation of CR (carriage return). With
+% the following line we make it an active character. Thus a macro
+% with the name |^^M| can now be defined.
+% \begin{macrocode}
+ \catcode`\^^M\active
+% \end{macrocode}
+% Since we use the verbatim package |\verbatim@processline| is called
+% after each line. We redefine it to do what we would like it to do:
+% Process the line with the macro with the name passed as argument..
+% The current line is available in |\verbatim@line|, a token register
+% \footnote{see: Latex hacks by Anselm Lingnau, p. 43 }.
+% \begin{macrocode}
+ \def\verbatim@processline{\csname#1\endcsname{\verbatim@line}}%
+% \end{macrocode}
+% Enter the real verbatim mode. From here on \emph{all} characters
+% have lost their special meaning (if they had any).
+% \begin{macrocode}
+ \verbatim@start}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endesk@cmds}
+% To end the invisible environment and the group started by
+% |\esk@cmds|, this macro has to be used.
+% \begin{macrocode}
+\def\endesk@cmds{%
+ \@esphack
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endesk}
+% This macro triggers the termination of the verbatim reading and
+% closes the current file.
+% \begin{macrocode}
+\def\endesk{%
+ \endesk@cmds
+ \endeskfile}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\eskdef}
+% An |eskdef| environment allows to store blocks of \SK{} code in
+% token list registers for using them in |esk| environments. The
+% macro has one parameter, the name of the definition. First a
+% private and local name for the new block is defined. Then
+% |\esk@def| checks if the name is already there and does the
+% rest.
+%% \iffalse TODO: Make it more robust by remembering old name
+%% and setting it back afterwards (if any), so it can
+%% be used in esk environments \fi
+% \begin{macrocode}
+\newcommand{\eskdef}[1]{%
+ %% Define a new name
+ \def\esk@@def@name{esk@def:#1}%
+ \esk@def}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\esk@def}
+% The |\esk@def| macro relies on |\esk@@def@name| being defined
+% previously. At the beginning it checks if that name is already
+% registered by looking for a control sequence with the defined
+% name. If so, an error message is produced.
+% \begin{macrocode}
+\def\esk@def{%
+ \expandafter\ifcsname\esk@@def@name\endcsname
+ \errmessage{"\esk@@def@name" is already defined!}
+ \fi
+% \end{macrocode}
+% If a new |eskdef| name is given a new token list register is
+% created and named like the expansion of |\esk@@def@name|. It
+% is not necessary to tell \TeX{} that the new register will be
+% global, because \emph{new...} tokens act always globally.
+% Unfortunately |\newtoks| is an |\outer| macro and we use the
+% wrapper |\tok@newtoks| (see below) to call it.
+% \begin{macrocode}
+ \expandafter\tok@newtoks\csname\esk@@def@name\endcsname
+% \end{macrocode}
+% Create or override a global definition |\esk@@def@reg|
+% containing our new token register. Unfortunately, this works only
+% with a global definition. Afterwards the verbatim reading of the
+% environment is started with a different verbatim line processor as
+% before. Finally the macro ends with removing the previously
+% defined alias for the new token list register.
+% \begin{macrocode}
+ \global\edef\esk@@def@reg{\csname\esk@@def@name\endcsname}
+ \esk@cmds{esk@def@verb@proc}}
+ \global\def\esk@@def@reg{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\esk@def@verb@proc}
+% The verbatim line processor for the |eskdef| environment first
+% creates a local alias for the new token list register. This is
+% done to make the code more readable.
+% \begin{macrocode}
+\def\esk@def@verb@proc#1{%
+ \expandafter\let\expandafter\token@reg\esk@@def@reg
+% \end{macrocode}
+% If the token list register is empty it is filled with the
+% current verbatim line.
+% \begin{macrocode}
+ \expandafter\ifx\expandafter*\the\token@reg*
+ \global\esk@@def@reg=\expandafter{\the#1}
+% \end{macrocode}
+% If not, the verbatim line is appended on a new line.
+% \begin{macrocode}
+ \else
+ \global\esk@@def@reg=\expandafter{%
+ \the\expandafter\token@reg\expandafter^^J\the#1}
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endeskdef}
+% On ending an |eskdef| environment |\endeskdef| is expanded. Here,
+% its only purpose is to invoke the macro ending the verbatim
+% input environment.
+% \begin{macrocode}
+\def\endeskdef{
+ \endesk@cmds}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\esk@@def}
+% A macro which takes a file name as argument to globally define
+% new macros |\esk@k:f:<arg>| and |\esk@k:c:<arg>| which expand
+% to |\theeskfile| and |\theeskfig| respectively.
+% \begin{macrocode}
+\def\esk@@def#1{%
+ \global\e@namedef{esk@k:f:#1}{\theeskfile}%
+ \global\e@namedef{esk@k:c:#1}{\theeskfig}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\e@namedef}
+% A macro which defines a new macro with the name of the
+% argument. This is done in use of |\expandafter| and
+% |\csname|...|\endcsname|. The new macro expands to the
+% following group, i.e. the new macros body. Due to the
+% use of |\edef| this happens dynamically.
+% \begin{macrocode}
+\def\e@namedef#1{%
+ \expandafter\edef\csname #1\endcsname}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\esk@use}
+% The |\esk@use| macro appends an \ESK{} \SK{} code definition
+% defined by |\eskdef|, into the currently defined file. After
+% creating an alias macro for the argument passed is is made
+% sure that the definition actually exists. If not an error
+% message is produced. If there is a token list register, named
+% like passed as argument, a short describing comment is written.
+% Further, the register is written as token to the file. The
+% file writing is finished with a new line.
+% \begin{macrocode}
+\def\esk@use#1{%
+ \def\esk@@def@name{esk@def:#1}%
+ \expandafter\ifcsname\esk@@def@name\endcsname
+ \eskwrite{\p@rcent\p@rcent\space included definition: #1}%
+ \expandafter\eskwritetoken\expandafter{%
+ \expandafter\csname\esk@@def@name\endcsname}
+ \eskwrite{^^J}
+ \else
+ \errmessage{esk: "#1" is undefined!}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tok@newtoks}
+% Since |\newtoks| is an |\outer| macro, it is not allowed in definitions.
+% Because we are in the need of creating token list registers on the
+% fly, we define a wrapper. It lets \TeX{} construct the |\newtoks| call:
+% \begin{macrocode}
+\def\tok@newtoks{
+ \csname newtoks\endcsname}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\futurespacelet}
+% A special version of the |\futurelet| macro. It is taken from Donald. E.
+% Knuths \emph{\TeX{}book} and behaves like |\futurelet|, but ignores spaces.
+% \begin{macrocode}
+\def\futurenospacelet#1{\def\cs{#1}%
+ \afterassignment\stepone\let\nexttoken= }
+% \end{macrocode}
+% Let |\stoken| be a space token:
+% \begin{macrocode}
+\def\\{\let\stoken= } \\
+% \end{macrocode}
+% And define the stepwise look-ahead macros:
+% \begin{macrocode}
+\def\stepone{\expandafter\futurelet\cs\steptwo}
+\def\steptwo{\expandafter\ifx\cs\stoken\let\next=\stepthree
+ \else\let\next=\nexttoken\fi \next}
+\def\stepthree{\afterassignment\stepone\let\next= }
+%</style>
+% \end{macrocode}
+% \end{macro}
+
+% \Finale
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \appendix
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \section{Driver File}
+%
+% \begin{macrocode}
+%<*driver>
+\documentclass[a4paper]{article}
+\usepackage{doc}
+\usepackage{amsmath}
+% \end{macrocode}
+% The logos would come out much nicer if |mflogo| would support some
+% more letters (i.e. k and K). We don't have that and so we define
+% the logos the following way:
+% \begin{macrocode}
+\def\ESK{\textsf{ESK}}%
+\def\SK{\textsf{Sketch}}%
+\def\MP{\textsf{META}\-\textsf{POST}}%
+
+% \end{macrocode}
+% Protect against certain outdated versions of the |kvsetkeys| package:
+% \begin{macrocode}
+\usepackage{kvsetkeys}[2007/09/29]
+\usepackage{tikz}
+\usepackage{esk}
+% \end{macrocode}
+% \begin{macrocode}
+\setlength{\parindent}{0pt}
+\def\manindex#1{\SortIndex{#1}{#1}}
+%<manual>\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{esk.dtx}
+\end{document}
+%</driver>
+% \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/esk/esk.ins b/macros/latex/contrib/esk/esk.ins
new file mode 100644
index 0000000000..fc7a32184b
--- /dev/null
+++ b/macros/latex/contrib/esk/esk.ins
@@ -0,0 +1,84 @@
+% esk.ins - Encapsulated Sketch for LaTeX(2e)
+% Copyright (C) 2010 Tom Kazimiers (tom AT voodoo-arts.net)
+% Based on the installer of emp latex package by Thorsten Ohl
+% (Thorsten.Ohl@Physik.TH-Darmstadt.de)
+% $Id: esk.ins,v 1.0 2010/05/04 20:50:59 kazimiers Exp $
+%
+% Esk 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.
+%
+% Esk 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{esk.ins}
+\input docstrip.tex
+\keepsilent
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\preamble
+
+Copyright (C) 2010 Tom Kazimiers (tom AT voodoo-arts.net)
+Based on the Makefile of emp latex package by Thorsten Ohl
+(Thorsten.Ohl@Physik.TH-Darmstadt.de)
+
+This file is NOT the source for esk, because almost all comments
+have been stripped from it. It is NOT the preferred form of esk
+for making modifications to it.
+
+Therefore you can NOT redistribute and/or modify THIS file. You can
+however redistribute the complete source (esk.dtx and esk.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.
+
+Esk 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 esk.sty for the esk package:}
+\generateFile{esk.sty}{f}{\from{esk.dtx}{style}}
+\Msg{Generating driver file for manual eskman.drv:}
+\generateFile{eskman.drv}{f}{\from{esk.dtx}{driver,manual}}
+\Msg{Generating driver file for documentation esk.drv:}
+\generateFile{esk.drv}{f}{\from{esk.dtx}{driver}}
+
+\Msg{***************************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the file}
+\Msg{* esk.sty into a directory searched by TeX}
+\Msg{*}
+\Msg{* Optionally you can copy the file eskman.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/esk/esk.pdf b/macros/latex/contrib/esk/esk.pdf
new file mode 100644
index 0000000000..02a95369ba
--- /dev/null
+++ b/macros/latex/contrib/esk/esk.pdf
Binary files differ
diff --git a/macros/latex/contrib/esk/eskman.pdf b/macros/latex/contrib/esk/eskman.pdf
new file mode 100644
index 0000000000..46b10e6591
--- /dev/null
+++ b/macros/latex/contrib/esk/eskman.pdf
Binary files differ