summaryrefslogtreecommitdiff
path: root/tex/generic
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2000-10-22 00:00:00 +0200
committerHans Hagen <pragma@wxs.nl>2000-10-22 00:00:00 +0200
commite78478392e9717499b101d0fed642c945c104097 (patch)
tree7f3dbe64040cbcf413644cae6516872c0fb5cd2b /tex/generic
parent73000ea3b7c8225c980f40ef90b86e2d57fe4003 (diff)
downloadcontext-e78478392e9717499b101d0fed642c945c104097.tar.gz
stable 2000.10.22
Diffstat (limited to 'tex/generic')
-rw-r--r--tex/generic/context/m-ch-de.tex10
-rw-r--r--tex/generic/context/m-ch-en.tex10
-rw-r--r--tex/generic/context/m-ch-nl.tex10
-rw-r--r--tex/generic/context/m-metapo.tex89
-rw-r--r--tex/generic/context/mptopdf.tex143
-rw-r--r--tex/generic/context/ppchtex.noc206
6 files changed, 468 insertions, 0 deletions
diff --git a/tex/generic/context/m-ch-de.tex b/tex/generic/context/m-ch-de.tex
new file mode 100644
index 000000000..467cdc670
--- /dev/null
+++ b/tex/generic/context/m-ch-de.tex
@@ -0,0 +1,10 @@
+% name : PPCHTEX / german interface
+% version : 1997.03.05
+% author : J. Hagen
+% copyright : J. Hagen, A.F. Otten
+
+\chardef\interfacenumber=2
+
+\input ppchtex.noc
+
+\endinput
diff --git a/tex/generic/context/m-ch-en.tex b/tex/generic/context/m-ch-en.tex
new file mode 100644
index 000000000..8c55a5669
--- /dev/null
+++ b/tex/generic/context/m-ch-en.tex
@@ -0,0 +1,10 @@
+% name : PPCHTEX / english interface
+% version : 1997.03.05
+% author : J. Hagen
+% copyright : J. Hagen, A.F. Otten
+
+\chardef\interfacenumber=0
+
+\input ppchtex.noc
+
+\endinput
diff --git a/tex/generic/context/m-ch-nl.tex b/tex/generic/context/m-ch-nl.tex
new file mode 100644
index 000000000..c9d77733a
--- /dev/null
+++ b/tex/generic/context/m-ch-nl.tex
@@ -0,0 +1,10 @@
+% name : PPCHTEX / english interface
+% version : 1997.03.05
+% author : J. Hagen
+% copyright : J. Hagen, A.F. Otten
+
+\chardef\interfacenumber=1
+
+\input ppchtex.noc
+
+\endinput
diff --git a/tex/generic/context/m-metapo.tex b/tex/generic/context/m-metapo.tex
new file mode 100644
index 000000000..6c2fa6fee
--- /dev/null
+++ b/tex/generic/context/m-metapo.tex
@@ -0,0 +1,89 @@
+%D \module
+%D [ file=m-metapo,
+%D version=1999.03.26,
+%D title=\LATEX\ Modules,
+%D subtitle=\METAPOST\ Inclusion,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ distribution and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D We quit when \CONTEXT\ is found and use some deep down
+%D macro to trigger this:
+
+\ifx\undefined\dodoplaceexternalfigure \else \expandafter \endinput \fi
+
+%D \macros
+%D {includeMPgraphics}
+%D
+%D This rather small \LATEX\ module is dedicated to David
+%D Arnold. It takes care of including the fonts used in
+%D \METAPOST\ graphics in the file. This hack is needed when
+%D one uses another \DVI\ driver than \DVIPS. This module
+%D falls back on the generic \CONTEXT\ support module:
+
+\ifx\undefined\includeMPfonts \input supp-mps.tex \relax \fi
+
+%D Instead of using \type {\includegraphics}, one should use its
+%D little brother \type {\includeMPgraphics}. This macro takes
+%D the same arguments.
+
+\def\includeMPgraphics#1#%
+ {\leavevmode\vbox\bgroup\hbox\bgroup
+ \def\includeMPgraphics##1%
+ {\includeMPfonts{##1}%
+ \includegraphics#1{##1}%
+ \egroup\egroup}%
+ \includeMPgraphics}
+
+%D An example of using this module is given below:
+%D
+%D \starttypen
+%D \documentclass[10pt]{article}
+%D
+%D \usepackage{graphicx}
+%D \usepackage{m-metapo}
+%D
+%D \begin{document}
+%D \includeMPgraphics{somefile.1}
+%D \includeMPgraphics[angle=90]{somefile.2}
+%D \end{document}
+%D \stoptypen
+%D
+%D This module needs \type {supp-mps} and \type {supp-mis},
+%D that both are present in the \CONTEXT\ path.
+%D
+%D Pleas do not forget to say \type {prologues:=2} at the
+%D top of the metapost file!
+%D
+%D For non \LATEX\ (and \CONTEXT) users we provide an
+%D alternative inclusion macro. This one has no optional
+%D arguments.
+
+\ifx\includegraphics\undefined
+
+ \ifx\undefined\dogetEPSboundingbox \input supp-eps.tex \relax \fi
+
+ \def\includeMPgraphics#1%
+ {\hbox\bgroup
+ \includeMPfonts{#1}%
+ \dogetEPSboundingbox{#1}{\dimen2}{\dimen4}{\dimen6}{\dimen8}%
+ \vbox to \dimen8
+ {\forgetall
+ \hsize\dimen6
+ \vfill
+ \hbox to \hsize
+ {\special
+ {PSfile="#1"\space
+ llx=\EPSllx\space
+ lly=\EPSlly\space
+ urx=\EPSurx\space
+ ury=\EPSury\space}}}%
+ \egroup}
+
+\fi
+
+\endinput
diff --git a/tex/generic/context/mptopdf.tex b/tex/generic/context/mptopdf.tex
new file mode 100644
index 000000000..15c56831d
--- /dev/null
+++ b/tex/generic/context/mptopdf.tex
@@ -0,0 +1,143 @@
+%D \module
+%D [ file=mptopdf,
+%D version=2000.03.27,
+%D title=\METAPOST,
+%D subtitle=conversion to \PDF,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D The file \type {mptopdf} provides a quick way to convert
+%D \METAPOST\ files to \PDF\ using a slightly stripped down
+%D plain \TEX, \PDFTEX, and a few \CONTEXT\ modules.
+%D
+%D First generate a format, which in \WEBC\ looks like:
+%D
+%D \starttypen
+%D pdftex --ini mptopdf
+%D \stoptypen
+%D
+%D or:
+%D
+%D \starttypen
+%D texexec --make --tex=pdftex --format=mptopdf --alone
+%D \stoptypen
+%D
+%D Since this conversion only works with \PDFTEX\ or \PDFETEX,
+%D the session is aborted when another \TEX\ is used. When
+%D finished, the resulting \type {fmt} file should be moved to
+%D the right location.
+%D
+%D The conversion itself is accomplished by:
+%D
+%D \starttypen
+%D pdftex &mptopdf \relax filename.number
+%D \stoptypen
+%D
+%D The \type {\relax} is needed since we don't want to process
+%D the file directly. Instead we pick up the filename using
+%D \type {\everypar}. Since this file is still the first one
+%D we load, although delayed, the jobname is as we expect. So,
+%D at least in \WEBC, the result of the conversion comes
+%D available in the file \type {filename.pdf}. This conversion
+%D process is roughly compatible with:
+%D
+%D \starttypen
+%D texexec --pdf --fig=c --result=filename filename.number
+%D \stoptypen
+%D
+%D This uses \CONTEXT, and is therefore slower. Therefore,
+%D we provide a small \PERL\ script that does a faster job,
+%D using the minimal format. Given that a format is
+%D generated, one can say:
+%D
+%D \starttypen
+%D mptopdf somefile
+%D mptopdf somefile.123
+%D mptopdf mp*.*
+%D \stoptypen
+%D
+%D The results are copied into files named \type
+%D {somefile-number}. This mechanism will also be available
+%D in a next release of \TEXUTIL.
+
+%D The \TEX\ implementation is rather simple, since we use some
+%D generic \CONTEXT\ modules. Because we need a few register
+%D allocation macros, we preload plain \TEX. We don't load
+%D fonts yet.
+
+\input syst-tex
+
+%D We check for the usage of \PDFTEX, and quit if another
+%D \TEX\ is used.
+
+\ifx\pdfoutput\undefined
+ \message{Sorry, you should use pdf(e)TeX instead.}
+ \expandafter \endinput
+\fi
+
+%D The conversion to \PDF\ is carried out by macros, that
+%D are collected in the file:
+
+\input supp-pdf
+\input supp-mpe
+
+%D We use no output routine.
+
+\output{}
+
+%D Since we need to calculate and set the bounding box,
+%D we definitely don't want to indent paragraphs.
+
+\parindent=0pt
+
+%D We use \type {\everypar} to pick up the filename and
+%D process the \METAPOST\ graphic.
+
+\everypar{\processMPfile}
+
+%D The main macro shows a few \PDFTEX\ primitives. The main
+%D work is done by the macro \type {\convertMPtoPDF} which is
+%D defined in \type supp-pdf}. This macro interprets the
+%D \METAPOST\ file. Close reading of this macro will probably
+%D learn a few (\PDF) tricks. Apart from some path
+%D transformations, which are needed since \PDF\ has a
+%D different vision on paths, the graphic is positioned in
+%D such a way that accuracy in \PDF\ xforms is guaranteed.
+
+\def\processMPfile#1 %
+ {\pdfoutput=1
+ \chardef\makeMPintoPDFobject=1
+ \hsize=100in
+ \vsize=\hsize
+ \hoffset=-1in
+ \voffset=\hoffset
+ \setbox0=\vbox{\convertMPtoPDF{#1}{1}{1}}%
+ \ifdim\wd0<1in \message{[warning: width<1in]}\fi
+ \ifdim\ht0<1in \message{[warning: height<1in]}\fi
+ \pdfpageheight=\ht0
+ \pdfpagewidth=\wd0
+ \box0
+ \bye}
+
+%D The \type {\chardef} forces the converter to build a so
+%D called xform object. This is needed in case the graphic
+%D uses special trickery, like shading.
+
+%D Since \ACROBAT\ has troubles with figures smaller than
+%D 1~inch, we issue a warning. When embedding graphics in
+%D documents, a size less that 1~inch does not harm. In
+%D order to overload runtime directives in the \PDFTEX\
+%D configuration file, we set the offsets and output method
+%D in the macro.
+%D
+%D The resulting \PDF\ file is about as efficient as such a
+%D self contained file can be. However, if needed, this \PDF\
+%D file can be converted to \EPS\ using for instance the
+%D \PDFTOPS\ program (in \WEBC) or \GHOSTSCRIPT.
+
+\dump
diff --git a/tex/generic/context/ppchtex.noc b/tex/generic/context/ppchtex.noc
new file mode 100644
index 000000000..81ec994e9
--- /dev/null
+++ b/tex/generic/context/ppchtex.noc
@@ -0,0 +1,206 @@
+%D \module
+%D [ file=ppchtex (m-chemie),
+%D version=1997.03.19,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=\PPCHTEX\ (Plain Pictex Context cHemie \TEX),
+%D author=Hans Hagen,
+%D date=\huidigedatum,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten},
+%D suggestions={Tobias Burnus, Dirk Kuypers \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See licen-en.pdf for
+%C details.
+
+%D This module facilitates the use of \PPCHTEX\ in macro
+%D packages other than \CONTEXT. One of the features of
+%D \CONTEXT\ is that the user interface can be in any
+%D language. This language is defined at loading time.
+%D
+%D This module is indeed a surrogate one and is only a poor
+%D man's alternative to the more extensive \type{mult-***}
+%D modules of \CONTEXT. The extra overhead in terms of macros
+%D and functionality that these modules offer is only useful
+%D in \CONTEXT.
+%D
+%D Two interfaces are supported here, but others can easily be
+%D defined. This module expects the general system macros to be
+%D loaded as wel as a interface switch \type{\ifalternativeinterface}
+%D to be set.
+
+%D First we load some auxiliary macro's:
+
+\input supp-mis.tex \let\writestatus\undefined
+\input syst-gen.tex
+
+%D after which we can go on with:
+
+\unprotect
+
+%D 0 = english
+%D 1 = dutch
+%D 2 = german
+%D 3 = czech (not yet implemented here)
+
+\ifx\interfacenumber\undefined
+ \chardef\interfacenumber=0
+\fi
+
+\def\definesystemvariable #1 %
+ {\setvalue{??#1}{@@#1}}
+
+\def\definesystemconstant #1 %
+ {\setvalue{s!#1}{#1}}
+
+\def\definevariable #1 #2 #3 %
+ {\ifcase\interfacenumber
+ \setvalue{v!#2}{#1}
+ \or
+ \setvalue{v!#2}{#2}
+ \or
+ \setvalue{v!#2}{#3}
+ \fi}
+
+\def\defineconstant #1 #2 #3 %
+ {\ifcase\interfacenumber
+ \setvalue{c!#2}{#2}
+ \setvalue{c!#1}{#2}
+ \or
+ \setvalue{c!#2}{#2}
+ \or
+ \setvalue{c!#2}{#2}
+ \setvalue{c!#3}{#2}
+ \fi}
+
+\def\definecommand #1 #2 #3 %
+ {\ifcase\interfacenumber
+ % core commands are english
+ \or
+ \doifnot{#1}{#2}{\setvalue{#2}{\getvalue{#1}}}
+ \or
+ \doifnot{#1}{#3}{\setvalue{#3}{\getvalue{#1}}}
+ \fi}
+
+\long\def\startcommands#1\stopcommands%
+ {}
+
+\def\dosetvalue#1#2#3%
+ {\p!doifundefined{\c!prefix!#2}%
+ \let\donottest=\doprocesstest
+ \@EA\def\csname#1#2\endcsname{#3}%
+ \else
+ \let\donottest=\doprocesstest
+ \@EA\def\csname#1\csname\c!prefix!#2\endcsname\endcsname{#3}%
+ \fi}
+
+\def\dosetevalue#1#2#3%
+ {\p!doifundefined{\c!prefix!#2}%
+ \let\donottest=\doprocesstest
+ \@EA\edef\csname#1#2\endcsname{#3}%
+ \else
+ \let\donottest=\doprocesstest
+ \@EA\edef\csname#1\csname\c!prefix!#2\endcsname\endcsname{#3}%
+ \fi}
+
+\def\docopyvalue#1#2#3%
+ {\p!doifundefined{\c!prefix!#3}%
+ \let\donottest=\doprocesstest
+ \@EA\def\csname#1#3\endcsname%
+ {\csname#2#3\endcsname}%
+ \else
+ \let\donottest=\doprocesstest
+ \@EA\def\csname#1\csname\c!prefix!#3\endcsname\endcsname%
+ {\csname#2\csname\c!prefix!#3\endcsname\endcsname}%
+ \fi}
+
+\def\doresetvalue#1#2%
+ {\dosetvalue{#1}{#2}{}}
+
+\def\dogetvalue#1#2%
+ {\csname#1\csname\c!prefix!#2\endcsname\endcsname}
+
+\defineconstant axis assenstelsel achsen
+\defineconstant top boven oben
+\defineconstant width breedte breite
+\defineconstant size formaat groesse
+\defineconstant number getal nummer
+\defineconstant height hoogte hoehe
+\defineconstant frame kader rahmen
+\defineconstant bodyfont korps fliesstext
+\defineconstant style letter schriftstil
+\defineconstant left links links
+\defineconstant offset offset offset
+\defineconstant bottom onder unten
+\defineconstant option optie option
+\defineconstant location plaats platz
+\defineconstant right rechts rechts
+\defineconstant resolution resolutie aufloesung
+\defineconstant scale schaal format
+\defineconstant status status status
+\defineconstant text tekst text
+\defineconstant textsize tekstformaat textgroesse
+\defineconstant alternative variant alternative
+\defineconstant x x x
+\defineconstant y y y
+
+\definevariable on aan an
+\definevariable big groot gross
+\definevariable intext intekst imtext
+\definevariable small klein klein
+\definevariable medium middel mittel
+\definevariable fit passend passend
+\definevariable start start start
+\definevariable stop stop stop
+\definevariable test test test
+\definevariable off uit aus
+
+\definecommand definechemical definieerchemie definierechemie
+\definecommand setupchemical stelchemiein stellechemieein
+\definecommand chemical chemie chemie
+\definecommand tochemical naarchemie zurchemie
+\definecommand startchemical startchemie startchemie
+\definecommand stopchemical stopchemie stopchemie
+\definecommand toptext boventekst textueber
+\definecommand bottext ondertekst textunter
+\definecommand midtext middentekst textmitte
+
+\protect
+
+%D After those definitions we actually load \PPCHTEX:
+
+\input ppchtex.tex
+
+%D We also change some setup values. Let's hope that the next
+%D setups forever suits \LATEX.
+
+\unprotect
+
+\ifx\bodyfontsize\undefined
+ \ifx\f@size\undefined
+ \ifx\@ptsize\undefined
+ \setupchemical[\c!korps=11pt]
+ \else
+ \setupchemical[\c!korps=1\@ptsize pt]
+ \fi
+ \else
+ \setupchemical[\c!korps=\f@size pt]
+ \fi
+\else
+ \setupchemical[\c!korps=\bodyfontsize]
+\fi
+
+\ifx\mathrm\undefined
+ \setupchemical[\c!letter=\rm]
+\else
+ \setupchemical[\c!letter=\mathrm]
+\fi
+
+\ifx\outputresolution\undefined
+ \setupchemical[\c!resolutie=300]
+\else
+ \setupchemical[\c!resolutie=\outputresolution]
+\fi
+
+\protect
+
+\endinput