home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / useful / dist / text / tex / pastex / macros / latex / general / lfonts.tex < prev    next >
Text File  |  1992-03-19  |  39KB  |  890 lines

  1. % File LFONTS - Version of 25 November 1991
  2. %
  3. % This version of LFONTS.TEX is for the CMR fonts.  It was converted
  4. % from the AMR version by David Fuchs on 18 December 1985.
  5. % And corrected on 11 Nov 1986 by Leslie Lamport.
  6. % Last vestige of AMR fonts removed 3 Mar 89 by Leslie Lamport.
  7. % Added \endinput 10 Oct 91 by RmS.
  8. % Added some \relax in front of \if's 25 Nov 91 by RmS.
  9.  
  10. % This file needs to be customized for the fonts available at a particular
  11. % site.  There are three places where changes need to be made.  They
  12. % can be found by searching this file for the string  FONT-CUSTOMIZING.
  13. %
  14. % FONT CONVENTIONS
  15. %
  16. % A TYPESTYLE COMMAND is something like \it that defines a type style.
  17. % Each style command \xx is defined to be \protect\pxx, where
  18. % \pxx is defined to choose the correct font for the current size.
  19. % This allows style commands to appear in 'unsafe' arguments where
  20. % protection is required.
  21. %
  22. % A SIZE COMMAND is something like \normalsize that defines a type size.
  23. % It is defined by the document style.  However, \normalsize is handled
  24. % somewhat differently because it is called so often--e.g., on every
  25. % page by the output routine.  The document style defines \@normalsize
  26. % instead of \normalsize.
  27. %
  28. % A ONE-SIZE typestyle is one that exists only in the \normalsize size.
  29. %
  30. % A FONT-SIZE COMMAND is one that defines \textfont, \scriptfont and
  31. % \scriptscriptfont for the font families corresponding to preloaded fonts,
  32. % as well as the typestyle commands for the preloaded fonts.  Each
  33. % font-size command has an associated @fontsize command, having the same
  34. % name except for an '@' at the front.   All font-size commands are defined
  35. % in LFONTS.  The naming convention is that a fifteenpt font has a font-size
  36. % name \xvpt, and so on.
  37. %
  38. % Each size command \SIZE executes the command
  39. %             \@setsize\SIZE{BASELINESKIP}\FONTSIZE\@FONTSIZE
  40. % which does the following.
  41. %   0. Executes \@nomath\SIZE to issue warning if in math mode.
  42. %   1. \let \@currsize = \SIZE
  43. %   2. Sets \strutbox to a strut of height .7 * BASELINESKIP and
  44. %      depth .3 * BASELINESKIP
  45. %
  46. %       Note: Charles Karney observed that step 2 is useless, since the
  47. %       \FONTSIZE command executed in step 4 resets \strutbox using
  48. %       the actual baselineskip, which is \baselinestretch * BASELINESKIP.
  49. %       Some day, this step may get removed.  (Note made 28 Feb 89)
  50. %
  51. %   3. Sets \baselineskip to \baselinestretch * BASELINESKIP
  52. %      and
  53. %   4. Calls \FONTSIZE
  54. %   5. Executes the \@FONTSIZE command.
  55. % It should then define all the typestyle commands not defined by the font-size
  56. % command, except for the one-size type styles. A typestyle command for which
  57. % the corresponding font exists but is not preloaded is defined to expand to a
  58. % \@getfont command.  A typestyle whose font does not exist is defined to
  59. % expand to a \@subfont command.
  60. %
  61. % A one-size typestyle whose font is not preloaded is defined to expand to
  62. % a \@onesizefont command.
  63. %
  64. % \em is defined to be \it inside an unslanted style and \rm inside a
  65. % slanted style.  An \em command in a section title will produce a \pem
  66. % command in the table of contents.
  67. %
  68.  
  69. \def\em{\protect\pem{}}
  70. \def\pem{\relax\ifdim \fontdimen\@ne\font >\z@ \rm \else \it \fi}
  71.  
  72. \def\normalsize{\relax\ifx\@currsize\normalsize \rm \else \@normalsize\fi}
  73.  
  74. % \load{SIZE}{STYLE} : Solves anomaly of loaded-on-demand font
  75. %    used for first time in math mode.  Give this command outside math
  76. %    mode, before formula using it for first time.
  77. \def\load#1#2{\let\@tempa\@currsize \let\@currsize\relax #1#2\@tempa}
  78.  
  79. % \newfont{\CMD}{FONT} defines \CMD to be the font FONT.
  80. %    It is equivalent to \font \CMD = FONT
  81. % \symbol{NUM} == \char NUM
  82.  
  83. \def\newfont#1#2{\@ifdefinable #1{\font #1=#2\relax}}
  84. \def\symbol#1{\char #1\relax}
  85.  
  86.  
  87.  
  88. % \@getfont \STYLE \FAM \@FONTSIZE{LOADING.INFO}
  89. %   \STYLE       = style command
  90. %   \FAM         = a control sequence defined by \newfam\FAM
  91. %   \@FONTSIZE   = the @fontsize command for the current size.
  92. %   LOADING.INFO = information needed to load the font--e.g.,
  93. %                  cmtti10 \magstep 2
  94. %   Does the following, where \FONTNAME denotes a new unique, untypeable
  95. %   font name:
  96. %    1. Executes  \font \FONTNAME = LOADING.INFO
  97. %    2. Appends '\textfont FAM \FONTNAME \def\STYLE{\fam \FAM \FONTNAME}'
  98. %       to the definition of \@FONTSIZE.
  99. %    3. Executes \@FONTSIZE \STYLE.
  100. %
  101. % \@nohyphens\STYLE\@FONTSIZE
  102. %   Used right after \@getfont to set \hyphenchar of the new font to -1,
  103. %   thereby prohibiting hyphenation.  It is used with \tt fonts.
  104. %   (\@nohyphens was added on 12/18/85)
  105. %
  106. % \@subfont \STYLE \REPSTYLE
  107. %   \STYLE, \REPSTYLE = type style commands.
  108. %   Types warning message and defines uses \REPSTYLE.
  109. %
  110. % \@onesizefont \STYLE {LOADING.INFO}
  111. %   Defines \STYLE to be a typestyle that exists only for the \normalsize
  112. %   size.  It produces the font specified by LOADING.INFO
  113. %
  114. % \@addfontinfo\@FONTSIZE{DEFS}
  115. %    Expands DEFS and adds to the definition of \@FONTSIZE. Items that should
  116. %    not be expanded should be protected with \@prtct---except no protection
  117. %    is needed for '\def\foo', only for the contents of the definition.
  118. %
  119. % \@nomath\CS : Types a warning '\CS used in math mode' if encountered
  120. %    in math mode.
  121.  
  122. % Remove \outer from definition of \newfam
  123. \def\newfam{\alloc@8\fam\chardef\sixt@@n}
  124.  
  125. \def\@setsize#1#2#3#4{\@nomath#1\let\@currsize#1\baselineskip
  126.    #2\setbox\strutbox\hbox{\vrule height.7\baselineskip
  127.       depth.3\baselineskip width\z@}\baselineskip\baselinestretch\baselineskip
  128.    \normalbaselineskip\baselineskip#3#4}
  129.  
  130. \newif\if@bold
  131.  
  132. \let\@prtct=\relax
  133.  
  134. \def\@addfontinfo#1#2{{\def\@prtct{\noexpand\@prtct\noexpand}\def\def{\noexpand
  135.     \def\noexpand}\xdef#1{#1#2}}}
  136.  
  137. \def\@getfont#1#2#3#4{\@ifundefined{\string #1\string #3}{\global\expandafter
  138.     \font \csname \string #1\string #3\endcsname #4\relax
  139.      \@addfontinfo#3{\textfont #2\csname \string #1\string #3\endcsname
  140.      \scriptfont #2\csname \string #1\string #3\endcsname
  141.      \scriptscriptfont #2\csname \string #1\string #3\endcsname
  142.      \def#1{\fam #2\csname\string #1\string #3\endcsname}}}{}#3#1}
  143.  
  144. \def\@nohyphens#1#2{\global\expandafter \hyphenchar\csname
  145.    \string #1\string #2\endcsname \m@ne}
  146.  
  147. \def\@subfont#1#2{\@warning{No \string#1\space typeface in
  148.         this size, using \string#2}#2}
  149.  
  150. \def\@onesizefont#1#2{\expandafter\newfam\csname fm\string#1\endcsname
  151.   \global\expandafter\font\csname ft\string#1\endcsname #2\relax
  152.   \gdef#1{\relax\ifx \@currsize\normalsize \@ftfam#1\else
  153.   \@warning{Typeface \string#1\space available only in
  154.   \string\normalsize, using \string\rm}\gdef #1{\relax\ifx \@currsize\normalsize
  155.   \textfont\@fontfam#1 \scriptfont\@fontfam#1 \scriptscriptfont
  156.   \@fontfam#1\@ftfam#1\else \rm\fi}#1\fi}#1}
  157.  
  158. \def\@ftfam#1{\fam\csname fm\string#1\endcsname\csname ft\string#1\endcsname}
  159.  
  160. \def\@nomath#1{\relax\ifmmode \@warning{\string#1\space in math mode.}\fi}
  161. \def\@nomathbold{\relax\ifmmode
  162.         \@warning{\string\mathbold\space in math mode.}\fi}
  163.  
  164. % The following definitions save token space.  E.g., using \@height
  165. % instead of height saves 5 tokens at the cost in time of one macro
  166. % expansion.
  167.  
  168. \def\@height{height}
  169. \def\@depth{depth}
  170. \def\@width{width}
  171.  
  172. \def\@magscale#1{ scaled \magstep #1}
  173. \def\@halfmag{ scaled \magstephalf}
  174. \def\@ptscale#1{ scaled #100}
  175.  
  176.  
  177. %% FONT-CUSTOMIZING:  The following \font commands define the
  178. %% preloaded LaTeX fonts.  Font names should be changed to cause
  179. %% different fonts to be loaded in place of these particular AMR fonts.
  180. %% \font commands should be added or deleted to change which fonts
  181. %% are preloaded.
  182.  
  183. % five point
  184.  \font\fivrm  = cmr5               % roman
  185.  \font\fivmi  = cmmi5              % math italic
  186.     \skewchar\fivmi ='177          %  for placement of accents
  187. %\font\fivmib = cmmib10  \@ptscale5 % bold math italic
  188.  \font\fivsy  = cmsy5              % math symbols
  189.     \skewchar\fivsy ='60           %   for placement of math accents
  190. %\font\fivsyb = cmbsy10 \@ptscale5 % bold math symbols
  191. %\font\fivit  = cmti7   scaled 714 % text italic
  192. %\font\fivsl  = cmsl10  \@ptscale5 % slanted
  193. %\font\fivbf  = cmbx7   scaled 714 % extended bold
  194. %\font\fivbfs =