Debian Codegraph @

texmf-dist/source/latex/base/newlfont.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 1993-2025
4 % The LaTeX Project and any individual authors listed elsewhere
5 % in this file.
6 %
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
9 %
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % https://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2008 or later.
17 %
18 % This file has the LPPL maintenance status "maintained".
19 %
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
22 % information.
23 %
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
27 %
28 % \fi
29 %\iffalse % this is a METACOMMENT !
30 %
31 %% File `newlfont.dtx'.
32 %% Copyright (C) 1989-1998 Frank Mittelbach and Rainer Sch\"opf,
33 %% all rights reserved.
34 %
35 %<*dtx>
36 \ProvidesFile{newlfont.dtx}
37 %</dtx>
38 %<package>\NeedsTeXFormat{LaTeX2e}
39 %<package>\ProvidesPackage{newlfont}
40 %<driver> \ProvidesFile{newlfont.drv}
41 % \fi
42 % \ProvidesFile{newlfont.dtx}
43 [1998/08/17 v2.2m Standard LaTeX package]
44 %
45 % \iffalse
46 %<*driver>
47 \documentclass{ltxdoc}
48 \begin{document}
49 \DocInput{newlfont.dtx}
50 \end{document}
51 %</driver>
52 % \fi
53 %
54 %
55 %
56 %
57 % \changes{v2.2a}{1994/01/17}{Added missing definitions to support
58 % newlfont in compat mode}
59 % \changes{v2.2b}{1994/01/27}{Removed if@compat test since
60 % these settings need also be executed in 2e mode.}
61 % \changes{v2.2c}{1994/03/06}{Added def for \cs{cal} and \cs{mit}}
62 % \changes{v2.2l}{1995/11/29}{Remove duplicate driver code.}
63 % \changes{v2.2m}{1998/08/17}{(RmS) Minor documentation fixes.}
64 %
65 % \providecommand\dst{\expandafter{\normalfont\scshape docstrip}}
66 %
67 %
68 % \GetFileInfo{newlfont.dtx}
69 %
70 % \title{The file \texttt{newlfont.dtx} for use with
71 % \LaTeXe.\thanks{This file has version
72 % number \fileversion, dated \filedate.}\\[2pt]
73 % It contains the code for \texttt{newlfont.sty}}
74 %
75 % \author{Frank Mittelbach}
76 %
77 % \MaintainedByLaTeXTeam{latex}
78 % \maketitle
79 %
80 % \section{Introduction}
81 %
82 % This file contains the code for the \texttt{newlfont} package
83 % which provides defines commands like |\rm| to behave as with
84 % NFSS1, i.e., to change one font attribute without resetting the
85 % other attributes.
86 %
87 % \MaybeStop{}
88 %
89 %
90 % \section{The Code}
91 %
92 % \begin{macrocode}
93 %<*package>
94 % \end{macrocode}
95 %
96 % We define the font commands for selecting the typeface. They are
97 % probably defined by the document class/style but we want to force
98 % the old meaning from NFSS1.
99 %
100 % \changes{v2.2g}{1994/05/11}{DPC Remove definitions of \cs{prm} etc.}
101 % \begin{macrocode}
102 \let\rm\rmfamily
103 \let\sf\sffamily
104 \let\tt\ttfamily
105 \let\bf\bfseries
106 \let\sl\slshape
107 \let\sc\scshape
108 \let\it\itshape
109 % \end{macrocode}
110 % We also have to define the \emph{emphasize} font change command
111 % (i.e.\ |\em|). This command will look whether the current font is
112 % sloped (i.e.\ has a positive |\fontdimen1|) and will then select
113 % either an upright or italic font.
114 % \changes{v2.2g}{1994/05/11}{DPC use \cs{DeclareProtectedCommand}}
115 % \changes{v2.2h}{1994/05/13}{DPC renamed to \cs{DeclareRobustCommand}}
116 % \begin{macrocode}
117 \DeclareRobustCommand\em{%
118 \@nomath\em
119 \ifdim \fontdimen\@ne\font >\z@\upshape \else \itshape \fi}
120 % \end{macrocode}
121 %
122 % For compatibility with old sources we should define the following
123 % commands although their use in new documents is discouraged.
124 % \begin{macrocode}
125 \let\mediumseries\mdseries
126 \let\normalshape\upshape
127 % \end{macrocode}
128 %
129 % In case \texttt{newlfont} is used in compatibility mode, eg
130 %\begin{verbatim}
131 % \documentstyle[newlfont]{article}
132 %\end{verbatim}
133 % or with the \texttt{oldlfont} package already loaded
134 % we have to undo a number of settings changed by the compatibility
135 % mode for \LaTeX~2.09 documents.
136 %
137 % |\@setfontsize| should not have a |\reset@font| included.
138 % \changes{v2.2j}{1994/11/06}{Use \cs{@typeset@protect}}
139 % \begin{macrocode}
140 \def\@setfontsize#1#2#3{\@nomath#1%
141 \ifx\protect\@typeset@protect
142 \let\@currsize#1%
143 \fi
144 \fontsize{#2}{#3}\selectfont}
145 % \end{macrocode}
146 % Math alphabet identifiers should have an argument.
147 % \changes{v2.2d}{1994/03/10}{Changed \cs{begingroup}/\cs{endgroup} to
148 % \cs{bgroup}/\cs{egroup}.}
149 % \changes{v2.2f}{1994/05/05}{Added saved versions of the
150 % math-groupers, CAR}
151 % \begin{macrocode}
152 \let\math@bgroup\bgroup
153 \def\math@egroup#1{#1\egroup}
154 \let \@@math@bgroup \math@bgroup
155 \let \@@math@egroup \math@egroup
156 % \end{macrocode}
157 % Warn again, if text font commands are used in math
158 % (same macro as in \texttt{lfonts.dtx}).
159 % \changes{v2.2e}{1994/04/21}{Changed error message}
160 % \changes{v2.2k}{1995/04/02}{add \cs{noexpand} to second part of message}
161 % \begin{macrocode}
162 \def\not@math@alphabet#1#2{%
163 \relax
164 \ifmmode
165 \@latex@error{Command \noexpand#1invalid in math mode}%
166 {%
167 Please
168 \ifx#2\relax
169 define a new math alphabet^^J%
170 if you want to use a special font in math mode%
171 \else
172 % \end{macrocode}
173 % We have to add |\noexpand| below to prevent expansion of |#2|. In
174 % case of |#1| we can omit this (due to the current definition of
175 % robust commands since they do come out right there :-).
176 % \begin{macrocode}
177 use the math alphabet \noexpand#2instead of
178 the #1command%
179 \fi
180 .
181 }%
182 \fi}
183 % \end{macrocode}
184 %
185 % In NFSS1 math alphabets had arguments so we have to change |\cal|
186 % and |\mit| which by default are defined to behave like in
187 % \LaTeX209.
188 % \begin{macrocode}
189 \let\pcal\@undefined
190 \let\cal\mathcal
191 \let\pmit\@undefined
192 \let\mit\mathnormal
193 % \end{macrocode}
194 %
195 % The NFSS1 version of \texttt{newlfont} included the \LaTeX{}
196 % symbols. And that is probably all there is.
197 % \begin{macrocode}
198 \RequirePackage{latexsym}
199 %</package>
200 % \end{macrocode}
201 %
202 %
203 % \Finale
204 \endinput