% This file is part of the NFSS2 (New Font Selection Scheme) package. % ------------------------------------------------------------------- % % Copyright (C) 1993 Frank Mittelbach and Rainer Schoepf, % All rights reserved % % IMPORTANT NOTICE: % % You are not allowed to change this file. % Copyright (C) 1993 Frank Mittelbach. All rights reserved % \documentstyle[doc]{article} \def\filedate{93/07/16} \newenvironment{decl} {\par\addvspace{4.5ex plus 1ex}% \noindent\hspace{-\leftmargini} \begin{tabular}{|l|}\hline\small} {\\\hline\end{tabular}\par\nopagebreak\addvspace{2.3ex}} \newcommand{\declline}[1]{\\\multicolumn1{|r|}{\small#1}} \MakeShortVerb{\|} \newcommand{\m}{\meta} \newcommand{\NFSS}{{\sf NFSS}} \def\AllTeX{(\La)\TeX} \makeatletter \ifx\DeclareFontShape\undefined \def\La{\TestCount=\the\fam \leavevmode L\raise.42ex \hbox{$\fam\TestCount\scriptstyle\kern-.3em A$}} \newcount\TestCount \else \def\La{L\kern-.36em {\setbox0\hbox{T}% \vbox to\ht0{\hbox{% \csname S@\f@size\endcsname \fontsize\sf@size\z@\selectfont A}% \vss}% }} \fi \makeatother \def\AmS{{\protect\the\textfont2 A}\kern-.1667em\lower .5ex\hbox{\protect\the\textfont2 M}\kern -.125em{\protect\the\textfont2 S}} \newcommand{\AmSLaTeX}{\AmS-\LaTeX} \newcommand{\ps}{PostScript} \newcommand{\MF}{Metafont} \setlength{\parindent}{0pt} \setlength{\parskip}{1pt plus 1pt} \ifx\oldstylenums\undefined \newcommand\oldstylenums[1]{$\fam1\relax#1$} % for this document % only \fi \begin{document} \title{Interface description of \NFSS{}2} \author{Frank Mittelbach} \date{\filedate} \maketitle \begin{abstract} \noindent This file contains a short description of the interfaces for \NFSS{} release 2. A full documentation of \NFSS{}2 can be found in the book: \begin{verbatim} @book(A-W:GMS93, author = {Michel Goossens and Frank Mittelbach and Alexander Samarin}, title = {The {\LaTeX} Companion}, publisher = Addison-Wesley, address = Reading, Massachusetts, year = 1993, bibliography = {yes}, index = {yes}, note = {to appear}, ) \end{verbatim} \end{abstract} \begin{small} \tableofcontents \par \end{small} \section{Short introduction (taken from the book)} At the time where \TeX{} was developed in 1979, only a dozen fonts have been set up for use with \TeX{}: the `Almost Computer Modern' fonts, also developed by Don Knuth\index{Knuth, Donald E.}. Since only these fonts were available, the approach for accessing them was very simple: a few control sequences were defined which changed from one external font to another. This situation had not changed much five years later when \LaTeX{} was first released, only the names of the fonts supplied which \AllTeX{} changed from `Almost Computer Modern'\index{Almost Computer Modern fonts} to `Computer Modern' (which are almost the same as the `Almost Computer Modern'). So it was quite natural that \LaTeX's font selection scheme followed the plain \TeX{} concept with the addition of size-changing commands which allowed typesetting in ten predefined sizes. As a result \LaTeX's font selection was far from general. For instance when defining a heading command to produce a bolder font (by using a |\bf| command in its definition) then the use of, say, |\sf| (for a sans serif font) inside such a heading did not produce a bold sans serif font but rather a medium weight sans serif font (the bold attribute was ignored). Similarly when, say, |\bf| was used inside an emphasized part the result was not a bold italic font, as normally desired, but rather a plain roman bold font. This behavior was due to the fact that all the font-changing commands like |\bf| referred to a fixed external font and so, rather than requesting an attribute change of the current font, they replaced the current font by another. Of course, \LaTeX{} enhanced the plain \TeX{} mechanism to a certain extent by providing a set of size changing commands, yet the underlying concept of the original release had a major drawback: the correspondence tables were hard-wired into \LaTeX{}, which made a change of the fonts used a difficult if not impossible task. Since that time low-priced laser printer have become available and with them a large number of font families from the \ps{} world and other worlds. Also the number of fonts in \MF{} source format (freely available to every \AllTeX{} installation) increased drastically. But unfortunately, there was no easy and standard method to integrate these new fonts into \LaTeX{}, so that typesetting with \LaTeX{} mostly meant typesetting in Computer Modern on almost all installations. Of course, individual fonts could be loaded, using the |\newfont| command. But this cannot be called integration: it requires a lot of user intervention, since such additional fonts do not change size under the control of size commands; and it does not allow to typeset a whole document in a different font family. \index{Computer Modern fonts|)} There have been a few efforts to integrate other fonts into \LaTeX{}, but this was done by exchanging one hard-wired font table with another, thus making the resultant \LaTeX{} as inflexible as the original one, only forcing the use of a different set of fonts. This unsatisfactory situation was finally changed with the release of the New Font Selection Scheme (abbreviated \NFSS{}) in 1989, which became widely known after it was successfully used in \AmSLaTeX{}. This is a system which contains a generic concept for varying font attributes individually and integrating new font families easily into an existing \LaTeX{} system. The concept is based on five attributes which can be defined independently to access different fonts, font characteristics or font families. For the realization of the concept some of the \LaTeX{} commands have been redefined and some new commands have been added. The following sections describe the interfaces of release~2 of \NFSS{}, which was completed at the end of 1992. This release, as far as the user interface is concerned, is intended for integration in \LaTeX3. \section{High level interfaces} \subsection{Switching text fonts} Font family changes are done with: \begin{verbatim} \textrm{...} \textsf{...} \texttt{...} \end{verbatim} Font series (weight/width) are changed with: \begin{verbatim} \textbf{...} \textmedium{...} \end{verbatim} The font shape is changed with: \begin{verbatim} \textit{..} \textsl{..} \textsc{..} \end{verbatim} Finally emphasis can be expressed with \begin{verbatim} \emph{..} \end{verbatim} All such commands take care of any necessary italic correction (|\/|). In case you want to suppress this extra space you can use \begin{verbatim} \nocorr \end{verbatim} just before the |\emph| command or just before the closing brace, to The above commands are also available as a separate style option |nffntcmd|. This option relies only on primitives and thus can be used with other macro packages such as plain \TeX, \LaTeX{} without NFSS, etc. \subsection{Accessing symbols} Use |\symbol{|\textit{number}|}| to select a symbol in position \textit{number} of the current font. The characters |'| or |"| at the beginning of \textit{number} denote octal or hexadecimal base, respectively. Use |\oldstylenums{|\textit{number}|}| to produce non-aligned digits like \oldstylenums{1982}. Works in text and math and honours spaces in the argument if used in text. Don't try to put other characters in the argument, the result would be unpredictable and may change in later releases. \subsection{Predefined math alphabets} \begin{verbatim} \mathnormal \mathcal \mathrm \mathbf \mathsf \mathit \mathtt \end{verbatim} If you use the above commands often, consider defining an abbreviation in the preambel of your document, e.g. \begin{verbatim} \newcommand{\mrm}{\mathrm} \end{verbatim} \subsection{Predefined math versions} The standard format has the math versions ``normal'' and ``bold'' predeclared. (You can switch between them using |\boldmath| and |\unboldmath| or directly using |\mathversion{...}|.) \subsection{Math declarations} \subsubsection{Declaring math versions} \begin{decl} |\DeclareMathVersion| \m{version-name} \end{decl} Defines \m{version-name} to be a math version. Initializes this version with the default for all symbol fonts declared so far (see |\DeclareSymbolFont|). Internally stores the stuff in |\mv@|\m{version-name}. If used on an already existing version, a warning is issued and all previous |\SetSymbolFont| declarations for this version are overwritten by the symbol font defaults, i.e.\ one ends up with a virgin math version. \begin{verbatim} Example: \DeclareMathVersion{normal} \end{verbatim} \subsubsection{Declaring symbol fonts} \begin{decl} |\DeclareSymbolFont| \m{sym-font-name} \m{cdp} \m{family} \m{series} \m{shape} \end{decl} Defines \m{sym-font-name} to be a symbolic name for a new symbol font. \m{cdp}\m{family}\m{series}\m{shape} are the default values for this symbol font in all math versions if not redefined later with a |\SetSymbolFont| command. Internally allocates a new math group with name |\sym|\m{sym-font-name}. Checks if \m{cdp} is a declared encoding scheme. \begin{verbatim} Example: \DeclareSymbolFont{operators}{OT1}{cmr}{m}{n} \DeclareSymbolFont{letters}{OML}{cmm}{m}{it} \DeclareSymbolFont{symbols}{OMS}{cmsy}{m}{n} \DeclareSymbolFont{largesymbols}{OMX}{cmex}{m}{n} (the first four standard math fonts) \end{verbatim} \begin{decl} |\SetSymbolFont| \m{sym-font-name} \m{version name} \m{cdp} \m{family} \m{series} \m{shape} \end{decl} Changes the setting for the symbol font \m{sym font name} in math version \m{version name} to \m{cdp}\m{family}\m{series}\m{shape}. Checks if \m{sym-font-name} is a symbol font, \m{version name} is a known math version and \m{cdp} is declared encoding scheme. \begin{verbatim} Example: \SetSymbolFont{operators}{bold}{OT1}{cmr}{bx}{n} \SetSymbolFont{letters}{bold}{OML}{cmm}{b}{it} (updating a bold math version) \end{verbatim} \begin{decl} |\DeclareSymbolFontAlphabet| \m{id} \m{sym-font-name} \end{decl} Allows to make use of the math alphabet contained in the symbol font that was declared earlier as \m{sym font name}. Checks that \m{id} can be defined and that \m{sym-font-name} is a symbol font. \begin{verbatim} Example: \DeclareSymbolFontAlphabet{\mathrm}{operators} \DeclareSymbolFontAlphabet{\mathcal}{symbols} \end{verbatim} \subsubsection{Declaring math alphabets} \begin{decl} |\DeclareMathAlphabet| \m{id} \m{cdp} \m{family} \m{series} \m{shape} \end{decl} Defines \m{id} to be a new math alphabet with the default \m{cdp} \m{family} \m{series} \m{shape} in all versions (the old |\newmathalphabet*| plus encoding scheme). If \m{shape} is empty then the \m{id} is declared to be invalid in all versions unless overwritten later by a |\SetMathAlphabet| command. Checks that \m{id} can be used and that \m{cdp} is a valid encoding scheme. \begin{verbatim} Example: \DeclareMathAlphabet{\foo}{OT1}{cmtt}{m}{n} \DeclareMathAlphabet{\baz}{OT1}{}{}{} (\foo is defined everywhere \baz by default nowhere) \end{verbatim} \begin{decl} |\SetMathAlphabet| \m{id} \m{version-name} \m{cdp} \m{family} \m{series} \m{shape} \end{decl} Changes the setting of the math alphabet \m{id} in math version \m{version-name} to \m{cdp}\m{family}\m{series}\m{shape}. Checks that \m{id} is a math alphabet, \m{version-name} is a math version and \m{cdp} is a known encoding scheme. \begin{verbatim} Example: \SetMathAlphabet\baz{normal}{OT1}{cmss}{m}{n} (now \baz is defined for `normal' only) \end{verbatim} \subsubsection{Declaring math symbols} \begin{decl} |\DeclareMathSymbol| \m{symbol} \m{type} \m{sym font name} \m{position} \end{decl} Defines cmd \m{symbol} to be a math symbol of type \m{type} (values 0-7 or symbolic see below) in font position \m{position} of symbol font \m{sym font name} which must have been declared previously. \m{position} can be decimal, octal, or hexadecimal with the usual notation |'| or |"| for octal and hex. \m{symbol} can be either a single character, eg `|>|', or a macro name, eg |\sum|. Allows overwriting of \m{symbol} if \m{symbol} is either a single character or was previously defined to be a math symbol. Symbolic values for \m{type} are the corresponding |\mathord|, |\mathbin|,\ldots{} commands. Checks that \m{symbol} can be used and \m{sym font name} is a declared symbol font. \begin{verbatim} Example: \DeclareMathSymbol{\alpha}{0}{letters}{"0B} \DeclareMathSymbol{\lessdot}{\mathbin}{AMSb}{"0c} \DeclareMathSymbol{\foo}{\mathalpha}{AMSb}{"0c} \end{verbatim} \begin{decl} |\DeclareMathDelimiter| \m{cmd} \m{type} \m{sym font name-1} \m{position-1} \declline{ \m{sym font name-2} \m{position-2} } \end{decl} or \begin{decl} |\DeclareMathDelimiter| \m{char} \m{sym font name-1} \m{position-1} \declline{ \m{sym font name-2} \m{position-2} } \end{decl} Defines \m{cmd} or \m{char} to be a math delimiter where the small variant is in font position \m{position-1} of symbol font \m{sym font name-1} and the large variant in font position \m{position-2} of symbol font \m{sym font name-2}. Both symbol fonts must have been declared previously. \m{position-i} can be decimal, octal, or hexadecimal with the usual notation ' or " for octal and hex. If \TeX{} is not looking for a delimiter \m{cmd} is treated just as if it had been defined with |\DeclareMathSymbol| (the first symbol name gets used). In other words, if a command is defined as a delimiter then this automatically defines it as a math symbol. However, if a single character is defined as a delimiter one can define it to behave completely different if used as a math symbol. Checks that \m{cmd} can be used and \m{sym font name-i} are declared symbol fonts. \begin{verbatim} Example: \DeclareMathDelimiter{.}{0}{00}{0}{00} ?????? \DeclareMathDelimiter{\langle}{\mathopen}{symbols}{"68} {largesymbols}{"0A} \end{verbatim} \begin{decl} |\DeclareMathAccent| \m{cmd} \m{type} \m{sym font name} \m{position} \end{decl} Defines \m{cmd} to act as a math accent. The accent character comes from \m{sym-font-name} in position \m{position}. The \m{type} can be either |\mathord| or |\mathalpha|, in the latter case the accent character changes fonts if used in a math alphabet. \begin{verbatim} Example: \DeclareMathAccent{\acute}{\mathalpha}{operators}{"13} \DeclareMathAccent{\vec}{\mathord}{letters}{"7E} \end{verbatim} \begin{decl} |\DeclareMathRadical| \m{cmd} \m{sym font name-1} \m{position-1} \declline{ \m{sym font name-2} \m{position-2} } \end{decl} Defines \m{cmd} to be a radical where the small variant is in font position \m{position-1} of symbol font \m{sym font name-1} and the large variant in font position \m{position-2} of symbol font \m{sym font name-2}. Both symbol fonts must have been declared previously. \m{position-i} can be decimal, octal, or hexadecimal with the usual notation ' or " for octal and hex. \begin{verbatim} Example: \DeclareMathRadical\sqrt{symbols}{"70}{largesymbols}{"70} (probably the only use for it :-) \end{verbatim} \subsection{Font loading} \subsubsection{Declaring encodings} \begin{decl} |\DeclareFontEncoding| \m{cdp} \m{text-settings} \m{math-settings} \end{decl} Declares a new encoding scheme \m{cdp}. The \m{text-settings} are declarations which are executed every time |\selectfont| switches to encoding scheme \m{cdp}. (More exactly, they are already executed when |\fontencoding| is encountered and the new encoding differs from the previous encoding.) This can be used for changing definitions of accents or other beasts that depend on font positions. \m{math-settings} is similar but for math alphabets (only!). It will be executed whenever a math alphabet with this encoding is called. Spaces within the arguments are ignored to avoid surplus spaces in the document in funny places. If a real space is necessary use |\space|. \begin{verbatim} Example: \DeclareFontEncoding{OT2}{}{\noaccents@} \end{verbatim} \begin{decl} |\DeclareFontEncodingDefaults| \m{text-settings} \m{math-settings} \end{decl} Declares \m{text-settings} and \m{math-settings} for all encoding schemes. These are executed before the encoding scheme dependent ones are executed so that one can use the defaults for the major cases and overwrite them if necessary using |\DeclareFontEncoding|. If |\relax| is used as argument, the current setting of this default is left unchanged. \begin{verbatim} Example: \DeclareFontEncodingDefaults{\relax}{\def\accentclass@{7}} (used by amsfonts.sty for accent positioning, changes only math settings.) \end{verbatim} \subsubsection{Font substitution} \begin{decl} |\DeclareErrorFont| \m{cdp} \m{family} \m{series} \m{shape} \m{size} \end{decl} Declares \m{cdp}\m{family}\m{series}\m{shape} to be the font shape used in cases where the standard substitution mechanism fails (= would loop). Also initializes |\f@encoding| \ldots{} |\f@baselineskip| with the corresponding values in case a |\selectfont| command is used during the early part of the style file. Enforces at |\begin{document}| that \m{cdp}\m{family}\m{series}\m{shape} is defined via |\DeclareFontShape|. \begin{verbatim} Example: \DeclareErrorFont{OT1}{cmr}{m}{n}{10} \end{verbatim} \begin{decl} |\DeclareFontSubstitution| \m{cdp} \m{family} \m{series} \m{shape} \end{decl} Declares the default values for font substitution which will be used when a font has to be loaded but can't be found with the current attributes. These are local to the encoding scheme because the encoding scheme is never substituted! They are tried in the order \m{shape} then \m{series} and finally \m{family}. If no defaults are set up for an encoding the values given by |\DeclareErrorFont| are used. Enforces at |\begin{document}| that \m{cdp}\m{family}\m{series}\m{shape} is defined via |\DeclareFontShape|. \begin{verbatim} Example: \DeclareFontSubstitution{T1}{cmr}{m}{n} \end{verbatim} \begin{decl} |\fontsubfuzz| |=| \m{dimen} \end{decl} Parameter that is used to decide whether or not to produce a terminal warning if a font size substitution takes place. If the difference between the requested and the choosen size is less than |\fontsubfuzz| the warning is only written to the transcript file. The default value is |0.4pt|. \begin{decl} |\fontsubmax| \end{decl} Parameter that holds the maximum deviation detected so far during font size substitution. It is currently not used by \NFSS{}. \subsubsection{Declaring font families} \begin{decl} |\DeclareFontFamily| \m{cdp} \m{family} \m{loading-option} \end{decl} Declares a font family \m{family} to be available in an encoding scheme \m{cdp}. \m{loading-option} are declarations that are executed for every font shape of that combination during load time (i.e.\ once). Checks if \m{cdp} was previously declared. \begin{verbatim} Example: \DeclareFontFamily{T1}{cmtt}{\hyphenchar\font=-1} (Computer modern typewriter in Cork encoding) \end{verbatim} \begin{decl} |\DeclareFontShape| \m{cdp} \m{family} \m{series} \m{shape} \m{loading-info} \m{loading-option} \end{decl} Declares a font shape combination where \m{loading-info} contains the information that combines sizes with external fonts. The syntax is complex and I will not dwell on it here, see below. \m{loading-option} are as above and allow overwriting the general loading options on family level for this individual shape. Checks if \m{cdp}+\m{family} was previously declared via |\DeclareFontFamily|. \begin{verbatim} Example: \DeclareFontShape{OT1}{cmr}{m}{sl}{% <5-8> sub * cmr/m/n <8> cmsl8 <9> cmsl9 <10> <10.95> cmsl10 <12> <14.4> <17.28> <20.74> <24.88> cmsl12 }{} \end{verbatim} \subsubsection{Preloading fonts} \begin{decl} |\DeclarePreloadSizes| \m{cdp} \m{family} \m{series} \m{shape} \m{size-list} \end{decl} Defines the font shapes that should be included into the format. \begin{verbatim} Example: \DeclarePreloadSizes{OT1}{cmr}{m}{sl}{10,10.95,12} \end{verbatim} \begin{decl} |\DeclareSizeFunction| \m{name} \m{code} \end{decl} Declares a size-function \m{name} for use in a |\DeclareFontShape| command. The interface is still lousy but then there should be no real need to a define new size functions. \m{code} is the code that should be performed when the size or size-range in |\DeclareFontShape| matches the requested user size. The size-functions arguments are automatically parsed and placed into |\mandatory@arg| and |\optional@arg| for inspection. Also available, of course, is |\f@size| which is the user requested size. To signal success \m{code} has to define the command |\external@font| to contain the external name and any scaling options of the font to be loaded. \begin{verbatim} Example: \DeclareSizeFunction{} {\edef\external@font{\mandatory@arg\space at\f@size} (the `empty' size function simplified) \end{verbatim} \section{Naming conventions} \subsection{Math alphabets} Math alphabets all start with |\math...|, e.g., |\mathbf|, |\mathcal|, etc. Define your private shorthands in the preamble if desired. \subsection{Text font changes} Text fonts with arguments start with |\text...|, e.g., |\textbf|, |\textrm|, |\emph|, etc. \subsection{Encoding schemes} Names for encoding schemes are strings of up to three letters all upper case. Currently the names officially supported by the \NFSS{}2 release are: \begin{center} \begin{tabular}{lll} \it Encoding & \it Description & \it declared by \\[2pt] T1 & \TeX{} text Cork encoding & \tt nfdcfnt \\ OT1 & \TeX{} text as defined by Don (more or less) & \NFSS{} \\ OT2 & \TeX{} text cyrill UW fonts & --- \\ OT3 & IPA University of Washington (AMS encoding) & --- \\ OML & \TeX{} math letters (italic) as defined by Don & \NFSS{} \\ OMS & \TeX{} math symbol as defined by Don & \NFSS{} \\ OMX & \TeX{} math extended symbol as defined by Don & \NFSS{} \\ U & Unknown encoding & \NFSS{} \\ \end{tabular} \end{center} This table will be extended in the future if the \TeX{} community, e.g.\ the national user groups, agree on additional encodings. Encoding schemes which are local to a site should start with |L|. Please don't use other starting letters for non-portable encodings. Instead, please inform us if a new standard encoding should be added to a later release. \subsection{Font families} Font family names should contain up to five lower case letters. \subsection{Font series} Font series names should contain up to four lower case letters. \subsection{Font shapes} Font shapes should contain up to two letters lower case. \subsection{Symbol fonts} Names for symbol fonts are built from lower and upper case letters with no restriction. \NFSS{} defines the following names for symbol fonts: \begin{center} \begin{tabular}{lll} \tt operators & fam 0 & where the operators normally come from\\ \tt letters & fam 1 & where the normal letters come from \\ \tt symbols & fam 2 & normal size symbols \\ \tt largesymbols & fam 3 & large size symbols \end{tabular} \end{center} \subsection{\protect\m{loading info} for {\tt\char'134 DeclareFontShape}} This consist of one or more \m{fontshape-decl}s having the following form: \DeleteShortVerb\| \MakeShortVerb\' \begin{quote} \m{fontshape-decl} '::=' \m{size-info} \m{font-info} \m{size-info} '::= "<"' \m{number-or-range} '">"' \m{font-info} '::=' $[$ \m{size-function} '"*"' $]$ '"["' \m{optarg} '"]"' \m{fontarg} '|' \m{fontarg} \end{quote} \DeleteShortVerb\' \MakeShortVerb\| The \m{number-or-range} denotes the size or size-range for which this for which this entry apply. If it contains a hyphen char it is a range: lower bound on the left (if missing zero implied), upper bound to the right of hyphen (if missing |\infty| implied). For ranges upper bound is $*$NOT$*$ included in the range, lower bound is. \begin{verbatim} Examples: <10> simple size: 10pt <-8> range: all sizes less than 8pt <14.4-> range: all sizes greater or equal 14.4pt \end{verbatim} If more than one \m{number-or-range} entry follows without any intervening \m{font-info} they all share the next \m{font-info}. The \m{size-function} if present handles the use of \m{font-info}. If not present, the `empty' \m{size-function} is assumed. All \m{size-info}s are inspected in the order in which they appear in the font shape declaration. If a \m{size-info} matches the requested size its \m{size-function} is executed. If |\external@font| is non-empty afterwards this process stops, otherwise the next \m{size-info} is inspected. (See also |\DeclareSizeFunction|.) If this process doesn't lead to a non-empty |\external@font|, \NFSS{} tries the nearest simple size. Implemented functions: \begin{description} \item[`' (empty)] load external font (in \m{fontarg}) at user requested size. If \m{optarg} present, used as scale-factor. \item[s] like the empty one but no terminal warnings, only loggings. \item[gen] generates external font from mandatory arg followed by the user requested size, eg |<8> <9> <10> gen * cmtt| \item[sgen] like the `gen' one but no terminal warnings, only loggings. \item[sub] tries to load font from a different fontshape declaration given by \m{fontarg} in form \m{family}"/"\m{series}"/"\m{shape}. \item[ssub] silent variant of sub, only loggings. \item[subf] like the empty one, but issues a warning, that it has to substitute the external font \m{fontarg} because the desired font shape wasn't available in the requested size. \item[ssubf] silent variant of subf, only loggings. \item[fixed] load font as is (disregarding user size) from \m{fontarg}. If present \m{optarg} denotes the ``at \dots pt'' size to be used. \item[sfixed] silent variant of fixed, only loggings. \end{description} \subsection{Font hooks} \NFSS{} provides a set of built-in hooks that modify the behavior of the high-level font change commands. These hooks are shown in table~\ref{tab:fontdefaults}. \begin{table} \noindent\hspace{-2cm}% \begin{tabular}{l l l} \multicolumn{1}{l}{\rm\it Hook} & \multicolumn{1}{l}{\rm\it Default value} & \multicolumn{1}{l}{\rm\it Description} \\[2pt] |\encodingdefault| & |OT1| & Encoding scheme for `main font' \\ |\familydefault| & |\rmdefault| & Font family selected for `main font' \\ |\seriesdefault| & |m| & Series selected for `main font' \\ |\shapedefault| & |n| & Shape selected for `main font' \\ |\rmdefault| & |cmr| & Font family selected by |\rm| and |\textrm| \\ |\sfdefault| & |cmss| & Font family selected by |\sf| and |\textsf| \\ |\ttdefault| & |cmtt| & Font family selected by |\tt| and |\texttt| \\ |\bfdefault| & |bx| & Series selected by |\bf| and |\textbf| \\ |\mediumseriesdefault| & |m| & Series selected by |\mediumseries| and |\textmedium| \\ |\itdefault| & |it| & Shape selected by |\it| and |\textit| \\ |\sldefault| & |sl| & Shape selected by |\sl| and |\textsl| \\ |\scdefault| & |sc| & Shape selected by |\sc| and |\textsc| \\ |\normalshapedefault| & |n| & Shape selected by |\normalshape| and |\textnormal| \end{tabular} \caption{Font attribute hooks} \label{tab:fontdefaults} \end{table} The inital setting of |\familydefault| means that changing only |\rmdefault| will also change |\familydefault| to its value. However, if |\familydefault| is changed |\rmdefault| is not affected. \section{Low level interfaces} \begin{decl} |\fontencoding| \m{encoding} \end{decl} \begin{decl} |\fontfamily| \m{family} \end{decl} \begin{decl} |\fontseries| \m{series} \end{decl} \begin{decl} |\fontshape| \m{shape} \end{decl} \begin{decl} |\fontsize| \m{size} \m{baselineskip} \end{decl} \begin{decl} |\selectfont| \end{decl} \begin{decl} |\usefont| \m{encoding} \m{family} \m{series} \m{shape} \end{decl} \section{Internal interfaces} Font attributes are held internally in local macros: \begin{verbatim} \f@encoding current encoding value \f@family current family value \f@series current series value \f@size current size value \f@baselineskip current baselineskip value \tf@size current text size for math (normally the same as \f@size) \sf@size current script size for math \ssf@size current scriptscript size for math Example of use: \fontsize{17.28}{\f@baselineskip} will set size to 17 without changing baselineskip. \end{verbatim} \subsection{Utilities} \begin{decl} |\hexnumber@| \m{num} \end{decl} Converts \m{num} into a single hex digit if in range $0 \leq \mbox{\m{num}} < 16$. Completely expandable and thus can be used to construct longer hex numbers in an emergency. \begin{verbatim} Example: \xdef\yen{\noexpand\mathhexbox\hexnumber@\symAMSa 55 } \end{verbatim} \begin{decl} |\f@warn@break| \end{decl} This command is used within warning messages generated by \NFSS{} and is defined to produce a new line beginning with the string ``|NFSS|'' (plus a suitable number of spaces) which means that it is fairly easy to extract all \NFSS{} related messages from the transcript file. If this is not desired one can redefine it to be less conspicuous, e.g., \begin{verbatim} Example: \def\f@warn@break{^^J\@spaces\@spaces\@spaces} \end{verbatim} \section{Incompatibilities and changes} \subsection{Compared to \LaTeX{} without \NFSS} \begin{itemize} \item Font commands do not cancel each other, e.g., \begin{verbatim} \sf\bf = Sans bold in NFSS \end{verbatim} \item Font commands like |\bf|, |\rm|, |\tt|, etc. are not allowed in math mode. Use the corresponding math alphabets or define your own. \end{itemize} \subsection{Compared to \NFSS{} release 1} \begin{itemize} \item The obsolete commands of \NFSS{}1, i.e., |\family|, |\series|, |\shape|, and |\size| have now been removed. Use |\fontfamily|, etc. instead. \item The math alphabets |\mit| and |\cal| have been renamed to |\mathnormal| and |\mathcal|. \item The following internal commands are obsolete in \NFSS{}2: |\extra@defs|, |\new@fontshape|, |\subst@fontshape|, |\newmathalphabet|, |\addtoversion|. Use the commands described above. \item All \NFSS{}1 style files have been changed to give a warning message and then load the correct \NFSS{}2 styles. Please update your documents to load the new styles if necessary. \begin{description} \item[concrete] still available as {\tt nfconcr} but should serve only as a template to see how |\mathversion|s can be introduced; use {\tt nfbeton} and/or {\tt nfeuler} instead. \item[margid] is default, use nfnewfnt if necessary. \item[nomargid] use {\tt nfoldfnt}. \end{description} \item In \NFSS{}1 an explicit request for |\fontsize{14}{16pt}| was actually trying to load a font at 14.4pt, in other words `14' was used as a label and not as a real size specification. In release 2 this request is now interpreted as asking for a font at `14pt' sharp. Since in the standard FontShape declarations such a font isn't available, \NFSS{} will attempt to use a nearby size and therefore will (after a warning) also use the `14.4pt' size, so documents will come out right. \item The internal switch |\ifdefine@mathfonts| to suppress math font changes was removed. Use |\ifmath@fonts| instead (but don't rely on it for future interfaces either :-) \end{itemize} \appendix \section{Debugging information} The following information is only provided for those who want to understand how the current interfaces work. It does not mean that any of these internals survive updates, so don't built them into your macros. \subsection{Lists holding information before {\tt\char'134 begin\{document\}}} \begin{verbatim} \alpha@list \alpha@elt \/// \end{verbatim} or \begin{verbatim} \alpha@elt \no@alphabet@error \no@alphabet@error \end{verbatim} \begin{verbatim} \cdp@list \cdp@elt {}{}{}{} \end{verbatim} \begin{verbatim} \group@list \group@elt \sym \/// \end{verbatim} \begin{verbatim} \version@list \version@elt \mv \end{verbatim} \subsection{Macros holding internal information} \begin{decl} |\|\m{font encoding}|+|\m{font family} \end{decl} holds default load options for this combination and can be used to check if there was a |\DeclareFontFamily| for this combination. \begin{decl} |\T@|\m{font encoding} \end{decl} holds the code to run when switching to this encoding in normal text. \begin{decl} |\D@|\m{font encoding} \end{decl} holds the default settings for \m{family}, \m{series}, \m{shape} substitution. \begin{decl} |\M@|\m{font encoding} \end{decl} holds the code to run when switching to this encoding within math (i.e.\ in a math alphabet). \begin{decl} |\S@|\m{size} \end{decl} holds the size definitions to be used in math for |\textstyle|, |\scriptstyle| and |\scriptscriptstyle| if \m{size} is the current text size (outside math). \subsection{Protected macros} Math alphabets are automatically made robust by internally defining \begin{verbatim} \def\foo{\protect\@foo} \def\@foo{...} \end{verbatim} \subsection{Undecided interfaces} Here are the interfaces that will most certainly change in the future, so try to avoid using them if not necessary. \begin{decl} |\define@mathsizes| \m{t-size} \m{s-size} \m{ss-size} \end{decl} Declares that \m{s-size} is the script size and \m{ss-size} the scriptscript size to be used in math, when \m{t-size} is the current text size. For text sizes for which no such declaration is given the script and scriptscript size will be calculated and then fonts are loaded for the calculated sizes or the best approximation (this may result in some warning message by \NFSS{}). \begin{verbatim} Example: \define@mathsizes{13.82}{10}{7} \end{verbatim} \subsection{Not implemented} \begin{decl} |\DeclareMathAlphabetCharacter| \m{char} \m{sym font name} \m{position} \end{decl} Declares \m{char}, which is either a single character like `A' or a command, to be a math character which can change its glyph representation within the scope of a math alphabet command. \m{sym-font-name} is the symbolic name of a symbol font and \m{position} the position in that font from which the character is fetched if found outside the scope of a math alphabet command. Inside the scope of such a command only the \m{position} is relevant. In that case the character is fetched from this position in the font corresponding to the math alphabet. (Comment: this means that one should declare characters to be math alphabet characters only if the `same' glyph exists in the same position in all math alphabets and in the default symbol font. This is usually the case for `letters' and digits and perhaps common punctuation characters.) \begin{verbatim} Example: \DeclareMathAlphabetCharacter{A}{letters}{'101} \end{verbatim} [ This is covered by |\DeclareMathSymbol| ] \begin{decl} |\mathsymbol| \m{type} \m{sym-font-name} \m{position} \end{decl} For informula use when one doesn't want to define a symbol name for it. Arguments just like |\DeclareMathSymbol|. \begin{verbatim} Example: \mathsymbol{7}{letters}{"0B} (alpha that accepts math alphabet changes :-) \end{verbatim} [ This is too weird ] \begin{decl} |\mathalpha| \m{chars} \end{decl} Checks if within a math alphabet scope and if so typesets \m{chars} in that alphabet even if they normally would not be subject to alphabet changes. This is the companion to |\mathord|, etc. Not implemented! [ And so this? ] \end{document}