%============================================================================= % T U G B O A T . T E X %============================================================================= %======================================================================== % A TeX file for the paper on APL-TeX (new version, not published) % % A.Hohti/O.Kanerva (University of Helsinki) April 1987 %======================================================================== % % % Version of August 26, 1987 at 15:00 % % %======================================================================== \input aplstyle % the file containing the APL definitions %======================================================================== % % \magnification=\magstep1 % for weak eyes! % % %======================================================================== \font\bigbf=ambx10 % for titles \font\sltt=amsltt10 % for file contents inside text \font\manual=manfnt at 10pt % for major METAFONT logo \font\minual=manfnt at 9pt % for minor METAFONT logo \input ninesize % abstract, references %======================================================================== % \def\METAFONT{{\manual META}\-{\manual FONT}} \def\metafont{{\minual META}\-{\minual FONT}} % %======================================================================== % stylistic definitions \def\section#1{\vskip0pt plus .1\vsize \penalty-250\vskip0pt plus-.1\vsize\bigskip \noindent{\bf #1.\ }\nobreak\message{#1}} \def\abstract#1{\bigskip\centerline{\hbox{ \vbox{\hsize=4.75truein{\ninepoint \noindent ABSTRACT.\enspace#1}}}}} \def\APL{{\sl APL}} % this definition is from the TeXbook, Ex. 21.3 : \def\boxit#1{\vbox{\hrule \hbox{\vrule \kern2pt \vbox{\kern2pt#1\kern2pt}\kern2pt\vrule}\hrule}} % A macro for making references and blocks. % \newdimen\refindent\newdimen\plusindent \newdimen\refskip\newdimen\tempindent \newdimen\extraindent \newcount\refcount % % \refskip has to be set by the user! Otherwise \parindent is % used, in accordance with \item. % \refcount=0 \def\ref#1:#2.-#3\par{\ninepoint % switch to nine point fonts \advance\refcount by 1 \setbox0=\hbox{[\number\refcount]}\refindent=\wd0 \plusindent=\refskip\extraindent=\refskip \advance\plusindent by -\refindent\tempindent=\parindent % \parindent=0pt\par\hangindent\extraindent % [\number\refcount]\hskip\plusindent #1:{\sl#2},#3 \parindent=\tempindent} % \refskip=\parindent % %======================================================================== % HEADER \null \vskip2truecm % \centerline{\bigbf GENERATING AN \APL\ FONT} % \vskip.75truecm % \centerline{\sl Aarno Hohti and Okko Kanerva} % \vskip.5truecm % \centerline{\sl University of Helsinki} \vskip.5truecm \abstract{The \APL\ language is well known for its peculiar symbols which have inhibited the use of this language in many programming environments. Making \APL\ documents of good quality has been difficult and expensive. We describe here a simple way how to use \metafont\ to generate an \APL\ font for \TeX\ by using existing font definitions as far as possible.} \vskip.5truecm %======================================================================== % \section{Introduction} This note describes an interesting exercise in using \METAFONT\ to produce new typefaces by combining letters from standard fonts. As we know, the \APL\ language [6] of Kenneth Iverson has never gained the popularity it deserves which is largely due to its strange symbol set. Indeed, true \APL\ users require a special keyboard to support the nonstandard but powerful operator symbols. Moreover, putting \APL\ into print has always been a problem, and modern low cost computerized typesetting programs do not usually support \APL\ style. \TeX\ can be used to produce high quality printouts for technical text, and it would be desirable to have a possibility to mix in \APL\ code. The companion program of \TeX ---\METAFONT ---provides a full means for a simple generation of an \APL\ font for \TeX, and the purpose of this note is to inform other people about the result we have obtained at the University of Helsinki. Let us note that there are at least three other \APL\ fonts available for small computer environments. Indeed, the newsletter \APL\ {\it Quote Quad\/}\footnote{*}{{\ninepoint Newsletter of SIGAPL, the Special Interest Group for \APL. {\it Quote Quad\/} has the same status in the world of \APL\ as TUGboat in \TeX{nical} world.}} is produced by using TROFF, and there exists a Postscript \APL\ font for the Apple Laserwriter [5] and another font for the TEXT typesetting system [2]. Consider the following usual kind of function definition in \APL: \choosett{apl} \begintt @DLS_SUMSQ N;I [1] S_I_0 [2] @GO(N@@ROI)/LOOP @endsym } $$\boxit{\boxit{\box0}}$$ \centerline{\sevenrm An APL function for polynomial multiplication} \endtt % gives the output % \choosett{apl} \setbox0=\vbox{\hsize=5.7truein \begintt [0] Z_A1 PROD A2;A;I;V [1] "RETURNS THE PRODUCT OF THE POLYNOMIALS A1 AND A2 [2] "THE ARGUMENTS ARE GIVEN AS COEFFICIENT ARRAYS [3] I_@ROA1 [4] Z_A1@SO.#A2 [5] LOOP:V_@ROZ @DM V[(@ROI)+1]_V[1] [6] V_@ROZ_Z,[(@ROI)+1]V@RO0 [7] A_(1+-@IOV[1])@SO.#((@NT(@IO@ROV)@EP(1,(@ROI)+1))/V)@RO1 [8] Z_+/[1]A@RV[(@ROI)+1]Z [9] ((@RO@ROZ)>@ROI)/LOOP \endtt } $$\boxit{\boxit{\box0}}$$ \centerline{\sevenrm An APL function for polynomial multiplication} % \section{User extension} A modern user of a computerized typesetting facility will probably ask if it is possible to extend or modify fonts coming with the system. As with [5], where the font has an {\it analytic\/} and a {\it bitmapped\/} variant, we can distinguish between the need of modifying {\it cmapl10\/} via \METAFONT\ and modification of the pixel files. \APL\ symbols of various ``blackness'' or ``thickness'' may be desirable. Indeed, in [3] the user input is written with boldface \APL\ symbols and the answers from the interpreter with thin ones. Furthermore, certain screen previewers use specific small size pixel files, and do not support the \APL\ font. The modification of the font by changing the values of some global variables in the preamble of the \METAFONT\ file is easy and can be done by following how it is done in standard fonts such as {\it cmbx10\/} etc. This is the recommended way, too. However, if \METAFONT\ is not available, then one must attack the pixel files. For direct hand editing, we use a program that converts a pixel file into a (bitmapped) text file acceptable to any standard screen editor, and another program reading the edited file back into a \TeX\ pixel file. Scaling fonts down to a desired size can be done in a similar (but automatic) manner; this facility is needed by a previewer (written by the first author) not using runtime scaling. \section{References} \bigskip { \ref Digital Equipment Corporation: VAX-11 \APL\ Reference Manual.- 1983. \ref Feldberg, Ian: TEXT: Publication-Quality Characters Come to \APL\ Graphics.- Proceedings of the 1986 \APL\ Conference, SIGAPL, pp.\ 306--313. \ref Gilman, Leonard, and Allen J.\ Rose: \APL, An Interactive Approach.- John Wiley \& Sons, Inc., 1984. \ref Grenander, Ulf: Mathematical Experiments on the Computer.- Academic Press, 1982. \ref Howland, John E.: Typesetting \APL\ Using a Macintosh.- Proceedings of the 1986 \APL\ Conference, SIGAPL, pp.\ 301--305. \ref Iverson, Kenneth: A Programming Language.- Wiley, New York, 1962. } \bigskip \section{The address} \bigskip {\ninepoint\obeylines \hskip\refskip University of Helsinki \hskip\refskip Department of Mathematics \hskip\refskip Hallituskatu 15 \hskip\refskip SF--00100 HELSINKI \hskip\refskip FINLAND } \end