%&latex %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% This is the file mathinst.tex, part of the MathInst package %% (version 1.0, August, 1998) for math font %% generation. (Author: Alan Hoenig, ajhjj@cunyvm.cuny.edu) %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass{article} \newcommand{\mathinst}{{\it MathInst\/}}\let\MathInst=\mathinst \let\tex=\TeX \let\latex=\LaTeX \font\mffont=logo10 \def\mf{{\mffont META}\-{\mffont FONT}} \newcommand{\vfinst}{{\it VFinst\/}} \def\ang<#1>{$\langle$\textnormal{\textit{#1}}$\rangle$} \title{The MathInst Package (version 1.0): New Math Fonts for \TeX} \author{Alan Hoenig} \begin{document} \maketitle If you've ever wanted to typeset proper mathematics using Caslon or Garamond or Baskerville or whatever types, \mathinst\ may be of use to you. It allows you to create proper math fonts for use by \TeX\ and \LaTeX. You need to tell it the family of Roman types you want to use and the raw math fonts---MathTime, Euler, Lucida New Math, or Mathematica---you can supply, and this script does the rest. All of \mathinst's fonts are properly scaled for compatibility with the Roman fonts. If you supply the name of a typewriter and sans serif font as well, MathInst will not only create fonts that respond to the \textsc{nfss} commands \verb+\mathsf+ and \verb+\mathtt+, it will also scale these fonts properly to match the Roman math fonts. If you supply the name of a calligraphic, fraktur, blackboard bold, and Greek bold font, \mathinst\ will create matching fonts and commands for their use. In particular, if a Greek bold is present, \mathinst\ will create bold math fonts. \mathinst\ also creates two style files---one for use by \textsc{nfss} (\LaTeX) and one for plain \TeX. There are also two matching test files, so you can not only test the fonts, but see how to access these fonts in a \TeX\ document. At the end, \mathinst\ places all your new fonts in their proper places, whether you use a traditional or a \textsc{tds} \TeX\ system. For many additional details, please read the remainder of this document. All the \mathinst\ material can be found in the {\tt fonts/utilities/mathinst} area of \textsc{ctan}. Please forward comments and bug reports to me (Alan Hoenig) at {\tt ajhjj@cunyvm.cuny.edu}. This current version contains several bug fixes, and benefited immensely from some mighty bug-catchers, including David Ness, Karen Ettinger, Christian Burger, Erik Luijten, and Jens-Peer Kuska. \section{Background; purpose; description} Although there are hundreds of outline fonts that \tex\ can use to typeset non-technical material, it remains difficult to typeset technical documents using typefaces other than Computer Modern. Difficulties remain even when special math fonts are made available (such as Hermann Zapf's Euler fonts or the MathTime fonts), because specialized knowledge is needed to integrate the math fonts with the text fonts. It is the purpose of the \mathinst\ software to perform this integration for an author or typesetter. Providing the author is willing to make some reasonable compromises, hundreds of new math families are now available. The \mathinst\ software itself knows about four families of raw math fonts---MathTime, Lucida New Math, Euler, and Mathematica. Here's what will be the result of a proper \mathinst\ font generation: \begin{enumerate} \item math fonts properly integrating raw math fonts with a given text font family; \item a macro file for users of plain \tex\ which properly integrates the new fonts; \item a style file for \latex\ users which integrates the new fonts into the \textsc{nfss}; \item test files for both plain \tex\ and \latex\ users which demonstrate the use of the new fonts; \item several log files which record aspects of the installation; and \item a script for placing all fonts and other files in their proper locations. \end{enumerate} In addition, the software checks to see if all target directories have been created. If not, a script has been prepared which will create the missing directories for you. This might be useful, for example, in preparing the many directories required by the \textsc{tds} (\tex\ Directory Structure) standard. The \mathinst\ software will work for ``traditional'' \tex\ systems (where all tfm's go in one place, all vf's in another, and so on) or for the newer \textsc{tds} systems. Standard math font families consist of text fonts plus special math fonts. If you supply certain additional fonts, \mathinst\ will integrate these other fonts in the math superfamilies. These optional additions include: \begin{enumerate} \item a typewriter font family; \item a sans serif font family; \item a fraktur font; \item a Blackboard Bold font; \item a calligraphic font; and \item a Greek bold font (for proper bold math fonts) \end{enumerate} Commands to typeset with these fonts are part of the styles that \mathinst\ creates; the test files contain examples illustrating their use. \mathinst\ takes great care to scale all fonts so the final fonts have an $x$-height identical to the original text fonts. This way, we obtain the highest degree of visual compatibility between otherwise disparate fonts. \subsubsection{What you will need} Here's what you'll need to run the software. \begin{itemize} \item The modules themselves have been written in Perl (Perl5, actually), so you'll need a Perl executable placed somewhere on your computer's search path. Perl is freely available for virtually every computer platform; you'll need to check out software archives to get hold of this language. \item You'll also need a version~1.5 or greater of {\it fontinst\/}, available from \textsc{ctan} in the area \texttt{fonts/utilities/fontinst/inputs}. (Retrieve all these files and place them in a \texttt{texinputs} directory.) \item You'll need a copy of Damian Cugley's {\tt pdcfsel} font selection scheme for plain \tex, which you can get in the \texttt{macros/plain/contrib/pdcmac} section of \textsc{ctan}. (Retrieve the two files \texttt{pdccode.tex} and \texttt{pdcfsel.dtx} from that directory and place them in a work directory. Run the \texttt{pdcfsel.dtx} through plain \TeX\ with a command like {\tt tex \&plain pdcfsel.dtx}; this generates the documentation file \texttt{pdcfsel.dvi} for \texttt{pdcfsel} and the package itself \texttt{pdcfsel.tex} which should be placed in a directory \TeX\ knows how to read from.) \item You'll need to install your text fonts {\bf strictly\/} according to the {\tt fontname2.1} standards. Information in the \texttt{info/fontname} section of \textsc{ctan} explains this standard in detail. Two freely available tools assist in this kind of installation: \begin{enumerate} \item \texttt{psnfss} by Sebastian Rahtz, and \item \vfinst\ by me; available in the {\tt fonts/utilities/vfinst} area of \textsc{ctan}. \end{enumerate} \item You need a version of \TeX\ that understands virtual fonts. Furthermore, you should configure your \TeX\ so that it knows to read input from its current directory, and the parent directory to this (as well as to other more conventional input directories). \end{itemize} \subsection{Platforms} The version supplied here runs under Unix and WindowsNT4.0. \subsection{Legal jargon and caveats} This software is distributed according to the terms of the GNU `copyleft' agreement. In addition, please note that if you make any alterations to any of the files in this package, you must change the names of the altered files. You are allowed to freely use this material and to pass it along (in the unaltered state!) provided you will not be using it to make money; otherwise, you must get in touch with me to secure permission. While the author hopes that it will prove useful, it is distributed with no guarantee or warranty whatsoever. Users should take \textsc{great care} to carefully back up their data before using. \section{Installing MathInst} Basic installation of this material involves placing files in proper directories. Thereafter, a few parameters need to be adjusted for your system. Create a separate directory with a name like {\tt mathinst} (say) somewhere on your system and place all the \mathinst\ software there. Create a working directory, with a name like {\tt work} directly below this directory. We'll call this directory the \mathinst\ working directory. \subsubsection*{Customizing the installation}Once the \mathinst\ modules are in place, you'll need to make to adjustments to some or all of the \verb|par| parameter files that pertain to an installation. {\em\mathinst\ will not run properly---and may not run at all---if these parameters are not set properly.} The parameter files are \verb|mt.par|, \verb|lu.par|, \verb|eu.par|, or \verb|ma.par| depending on which math fonts---MathTime, Lucida, Euler, or Mathematica---you'll be using. Once these variables have been set, \mathinst\ has been completely installed. These \verb|par| files all follow the same format. Several variables at the beginning record the location of important files, and all these statements follow Perl syntax---variable names that begin with \verb|$|, double quotes around strings, and statements ending with semicolons. Use the existing statements in the distribution files as models. For a typical traditional system, these variables have the following values. \begin{verbatim} $psfonts_ = "/psfonts"; $afm_ = "$psfonts_/afm"; $vf_ = "/usr/lib/tex/fonts/vf"; $tfm_ = "/usr/lib/tex/fonts/tfm"; $map_ = "/usr/lib/tex/ps"; $inputs_ = "/usr/lib/tex/inputs"; $texmf_ = "/usr/local"; $installer_ = "vfinst"; \end{verbatim} Table~\ref{mathinst-places}\ lists these variables and their meanings. The variable \verb|$texmf_| must {\bf only} be defined if your \tex\ system conforms to the \textsc{tds} standard (in which case, \mathinst\ ignores \verb|$psfonts_|, \verb|$afm_|, \verb|$vf_|, and \verb|$tfm_|; and \verb|$inputs_| holds the path where the \verb|fd| files are). In a \textsc{tds} system, \mathinst\ also needs a value for \verb|$installer_|. \begin{table} $$\vbox{\halign{\tt#\hfil\quad&\vtop{\hsize=2.75in \noindent#\smallskip}\cr \$psfonts\_&Where the outline font files are.\cr \$afm\_&Where the outline font metric files are.\cr \$vf\_&Where the \tex\ virtual font {\tt.vf} files are.\cr \$tfm\_&Where the \tex\ font metric {\tt.tfm} files are.\cr \$map\_&Where the {\tt dvips} map file {\tt psfonts.map} sits.\cr \$inputs\_&Where is a \tex\ input directory?\cr \$texmf\_&What is the root TDS directory?\cr \$installer\_&What installed the text fonts (vfinst or psnfss)?\cr }} $$ \caption{\label{mathinst-places}Some variables and their meanings.} \end{table} Following these variables are a list of variables recording the names of the math fonts as they are on your system. Adjust them as necessary. For the moment, leave the next few variables: \begin{itemize} \item \verb|$ssize_| and \verb|$sssize_|; \item \verb|$encoding_|; \item a collection of variables with names like \verb|$tt_|, \verb|$sansserif_|, and so on; and \item a set of variables, all of which end in \verb|...SF_| \end{itemize} commented out. In a Perl script, the comment character \verb|#| works in the same way as the percent character \verb|%| works in a \tex\ file. The default value for the \verb|$encoding_| variable is OT1; you may change it now to {\tt ot1} \begin{verbatim} $encoding_ = "ot1"; \end{verbatim} if you know for sure you are using all lowercase file names. \subsection{Installing raw math fonts}% The {\em raw\/} math fonts consist of a series of outline font files plus the associated \verb|afm| and \verb|tfm| files. It's easy to install these fonts. Here are the steps appropriate for traditional systems. \begin{enumerate} \item Place the math font files with the other scalable fonts. \item Place the \verb|afm| files with your other \verb|afm| files. \item Place the \verb|tfm| files where they belong. \item Make sure a proper entry exists for each math font in the \verb|map| file for your \verb|dvi| postprocessor. \end{enumerate} Only the last point requires additional comments. For example, for the {\tt dvips} \verb|psfonts.map| file, we need entries like {\fontsize{9}{10}\selectfont \begin{verbatim} %% MathTime fonts... mtsy MTSY /fonts/type1/\ang/\ang} \] and the \texttt{.afm} and \texttt{.tfm} files go in places like \[ \vbox{ \hbox{\tt \ang/fonts/afm/\ang/\ang} \hbox{\tt \ang/fonts/tfm/\ang/\ang} } \] After you've added new fonts to your \textsc{tds} system, you will need to run a utility like {\tt texhash} or {\tt configure} or {\tt mktexlsr} (or something equivalent; it will have been supplied with your system) to make these fonts and their locations known to the \textsc{tds} search engine. Here, \ang refers to the fontname abbreviation for the origin of the fonts, while \ang is a fontname name for the font family. Also, \ang is the root {texmf} directory. For example, the Euler fonts are provided courtesy of the American Mathematical Society ({\tt ams}), so scalable versions of these fonts belong in places named \[ \vbox{% \hbox{\tt \ang/fonts/type1/ams/euler} \hbox{\tt \ang/fonts/afm/ams/euler} } \] \subsubsection*{MathTime: Additional Comments} If the digits for a roman family are too idiosyncratic for use with mathematics, you may wish instead to use Times Roman digits in math modes. If this is the case, there is an additional parameter you can set in file {\tt mt.par}. Set the Perl variable \verb|$times_| to point to a raw Times Roman font. MathTime fonts are available from Y\&Y, Inc. \subsubsection*{Euler fonts: Additional Comments} The Euler fonts need to fleshed out using some characters from Computer Modern fonts. It may be convenient to use scalable versions of these fonts, and these are now freely available from two \textsc{ctan} sources---the BaKoMa fonts discussed above, and the Blue Sky fonts, recently placed in the \textsc{ctan} archive. However, scalable Euler fonts are only found in the BaKoMa suite. One of the most pleasant surprises in this font work was how handsome the Euler fonts work in combination with text fonts. The Euler fonts are the only math fonts (other than Computer Modern) which are available for free. \subsubsection*{Lucida New Math: Additional Comments} There are no bold versions of these fonts, so it is never appropriate to include a Greek bold font. Lucida New Math fonts are available from Y\&Y, Inc. \subsubsection*{Mathematica Math Fonts: Additional Comments} Wolfram Research had graciously made available to me a set of provisional fonts they developed for inclusion with their current version of the program {\it Mathematica}. I have no idea how closely the actual fonts as distributed match the ones I worked with, nor the policy under which these fonts are being made available. (Typically, an installation of Mathematica3.0 on a Windows NT system has these fonts located in the directories \begin{verbatim} Program Files\Wolfram Research\Mathematica\3.0\Fonts\Afm Program Files\Wolfram Research\Mathematica\3.0\Fonts\Type1 \end{verbatim} of a hard disk.) With these caveats, I detail the procedure for making these fonts usable by \TeX, which is more {\it ad hoc\/} than with other math fonts. The auxiliary files to assist in this task are in the {\tt makemma} directory in the \MathInst\ distribution. Here's the procedure. First, create and enter a {\tt work} subdirectory (below {\tt makemma}). I used the fonts named Math1 through Math5, each of which appears in regular and bold and mono and variable width variants. Use the file {\tt rename.bat} to rename these files and then (from the {\tt work} subdirectory) run the file {\tt makemma.tex} through \TeX. You'll need to make sure that the Mathematica {\tt.afm} files are in a place \TeX\ can read from. The output of the previous steps will be a bunch of {\tt.vpl} and {\tt.pl} files. Convert them to {\tt.vf} and {\tt.tfm} files, and move these files where they belong. Use commands like \begin{verbatim} vptovf mmami.vpl mmami.vf mmami.tfm pltotf mma1.pl mma1.tfm} \end{verbatim} to perform the conversions. Now you're ready to \MathInst\ using the Mathematica module. I found these fonts somewhat less satisfying than other math fonts. The characters seem to have been crafted with less care. For example, the cap heights of the calligraphic alphabet are not consistent. Also, the equal sign and double left- and right-arrows don't match, so they can't be used to generate long double arrows. (This can be fixed up with some kind of virtual mix-and-match scheme, but I have not yet done this.) \subsection{Installing the text fonts} The \mathinst\ utilities expect the text font family (and the sans serif fonts too) to be installed using the Berry font naming scheme. At the moment, \mathinst\ expects this to be done via the \vfinst\ utility (by the current author) or by \texttt{psnfss} (by Sebastian Rahtz). The text fonts \textit{must} have been installed using the original \TeX\ encoding (that is, \texttt{OT1} or \texttt{ot1}). \subsection{Running MathInst} \begin{enumerate} \item Once the \mathinst\ software has been properly installed, you execute a module by switching to the working directory issuing a command like \begin{verbatim} ../mathinst mt mbv \end{verbatim} (it would be \verb|..\mathinst mt mbv| in DOS). The double dots `\verb|..|' tell your computer to look for the \verb|mathinst| script in the parent of the current working directory and to use the the {\tt mt} (MathTime) math fonts and the text font family \verb|mbv| as arguments. At the moment, there are four allowable math abbreviations: \begin{itemize} \item \texttt{mt} (MathTime); \item \texttt{eu} (Euler); \item \texttt{lu} (Lucida); and \item \texttt{ma} (Mathematica). \end{itemize} The three-character font family must be the family name under which the text fonts have been installed. \mathinst\ produces the remainder of the scripts that you'll need to execute. \item Execute \texttt{mkdirs.bat} to create any missing directories. \item Execute \texttt{makepl.bat} to create certain property list files that fontinst will need. \item Run the file \texttt{makemath.tex} through \TeX. This is a plain \TeX\ file. \item Execute \texttt{makevf.bat} to create the binary font files that \TeX\ needs. \item Test the fonts, and make any changes (as described below). After making any adjustments, return to the `\TeX' step (step~4). \item When you are satisfied with the fonts, execute \texttt{putfonts.bat} to place all fonts, style files, and font descriptor files where they belong. Any files that remain in the working directory after this step can be safely deleted. \end{enumerate} All these steps take little time to execute. \subsection{Log files} \mathinst\ creates three log files with the extension \texttt{.mlg}. The files \texttt{makepl.mlg} and \texttt{makevf.mlg} contain information about the process used to create property files and font files. The name of the third log file begins with a `{\tt z}', followed by the 2-character math abbreviation, followed by the 3-character font family name. Thus, if I create math fonts from Caslon ({\tt pac}) combined with Euler ({\tt eu}), the third log file is called {\tt zeupac.mlg}. This file records many of the decisions made by \mathinst\ as well as many of its findings as it prepares scripts for your fonts, and this information may sometimes be of interest. \subsection{Making adjustments} The fonts that the above process produces are at best good approximations to high quality fonts. Fine details pertaining to character spacing have to be made by hand. \mathinst\ tries to make this as easy as possible. For each run, it creates three ``fudge'' files: \[\vbox{\tt\hbox{ \angrhax.mtx}\hbox{ \angihax.mtx}\hbox{ \angiskew.mtx}} \] So, if you run \mathinst\ on Monotype Baskerville fonts (family name {\tt mbv}), you get three files {\tt mbvrhax.mtx}, {\tt mbvihax.mtx}, and {\tt mbviskew.mtx}. Once these files are present in the working directory or its parent \mathinst\ directory, \mathinst\ never overwrites them, since you may well have recorded changes in these files. The two {\tt...hax} files allow you to make changes to the math glyphs themselves in the math roman and math italic fonts. This is by means of a command \verb+\shiftglyph+, whose usage is described in these files. This command allows you to adjust the amount of space on either side of a character, and the related amount by which subscripts nestle against the character. The {\tt...skew} file makes it possible to adjust the positioning of accents on a math italic character, by means of a command called \verb+\skewkern+. In all cases, determining the numerical amounts to adjust various characters is a matter of trial and error. \section{% Your new math virtual fonts% } The new math font families use the {\em z naming convention}, whereby the font family name for the new math fonts uses the two character math designations together with the text font family designation. Suppose we combine MathTime (\verb|mt|) with Baskerville, whose family designation is \verb|mbv| in the Berry scheme. The new fonts will be described in macro files \verb|zmtmbv.tex| and \verb|zmtmbv.sty| (for users of plain \tex\ or of \latex). Baskerville plus Euler or Baskerville plus Lucida would form the $z$-names \verb|zeumbv| and \verb|zlumbv|. The $z$-name \verb|zmambv| describes a marriage between Baskerville and the {\it Mathematica\/} math fonts. The fonts themselves follow the Berry scheme, but you don't need to keep track of this, since the \mathinst\ style files load the fonts for you automatically and establish their correspondence either with familiar nicknames (\verb|\it|, \verb|\bf|) or with the \textsc{nfss}. But if you find yourself poking about your font directories, here's a quick key to the many new fonts you'll see. Additional font variants \verb|m|, \verb|e|, \verb|l|, or \verb|a| indicate a math font using MathTime, Euler, Lucida New Math or Mathematica fonts, while variants \verb|m|, \verb|y|, or \verb|v| denote the math italic, symbol, or extension fonts. For Baskerville, the four math fonts using MathTime fonts at text size have names \begin{itemize} \item \verb|mbvrm7t|, the math Roman font; \item \verb|mbvrm7m|, the math italic font; \item \verb|mbvrm7y|, the symbol font; and \item \verb|mbvrm7v|, the extension font. \end{itemize} A math Roman font connecting Baskerville and Euler or Baskerville and Lucida would be called \verb|mbvre7t| or \verb|mbvrl7t|. Baskerville $+$ Mathematica gives rise to the math Roman font \verb|mbvra7t|, and so on. \mathinst\ does its best to `fake out' new fonts at the script and scriptscript sizes. Computer Modern fonts provide the r\^ole model---those fonts are subtly redesigned at different sizes. Smaller fonts sizes also display greater letterspacing (additional space between adjacent characters)at smaller sizes. We can't redesign a scalable font, but we can create virtual fonts which differ only in the letterspacing for use in various contexts. \mathinst\ creates installation files which take letterspacing into account. Therefore, you will see as many as three fonts for each of the above varieties listed above. In addition to \verb|mbvrm7t|, the math Roman font for text sizes, you'll see \verb|mbvrm7t7| and \verb|mbvrm7t5|, the same fonts fine-tuned for use in script and scriptscript contexts. (The suffixes `7' and `5' recall the design sizes of seven and five points that Computer Modern typesetting uses for these sizes.) There is only a single extension font for any family. \subsection{Using the new fonts} Whether you use \latex\ or plain \tex, you'll only need to remember the $z$-name for your new fonts. One purpose of the \mathinst\ test files is to provide living examples showing just how the new fonts are invoked. In a \latex\ document, all the work is done by the package file whose first name is precisely the $z$-name for the math fonts. As with all package files, its extension is \verb|sty|. If you add a line like \begin{verbatim} \usepackage{zmtmbv} \end{verbatim} following {\tt\string\documentclass\string{...\string}} then all the usual \latex\ font switching mechanisms will now apply to the \verb|zmtmbv| fonts rather than to the default Computer Modern fonts. There is no font selection scheme for plain \tex\ quite all-encompassing as is the \latex\ NFSS, but Damian Cugley's \verb|pdcfsel| comes gratifyingly close, and does one or two things better than NFSS. Like the \latex\ package, the plain macro file has the font $z$-name as its first name, but the extension is \verb|tex|. To use these macros, simply place a statement like \begin{verbatim} \input zmtmbv \end{verbatim} very near the beginning of your file. Thereafter, all the usual plain font commands like \verb|\it|, \verb|\rm|, \verb|\tt|, \verb|$|, \verb|$$|, and so on refer to the new math fonts. The \verb|pdcfsel| package itself provides more flexibility than plain users are used to, and it would be well worth any reader's time to gain familiarity with this package. \smallskip For additional information regarding the installation and use of \mathinst{} (including an extensive display of sample output), please see the book {\it \tex\ Unbound: \latex\ and \tex\ Strategies for Fonts, Graphics and More\/} by Alan Hoenig (1998, Oxford University Press). \section{Communicating with the author} Please feel free to get in touch with me (Alan Hoenig) if you have any comments or bug reports. \begin{flushright} Alan Hoenig\\ {\tt ajhjj@cunyvm.cuny.edu}\\ John Jay College\\ Department of Mathematics\\ 445 West 59th Street\\ New York, NY 10019 USA\\[1pc] 25 August 1998 \end{flushright} \end{document}