-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefoldfonts.dtx
251 lines (246 loc) · 9.67 KB
/
defoldfonts.dtx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
% \iffalse meta-comment
% ======================================================================
% defoldfonts.dtx
% Copyright © 2008–2023 Markus Kohm
%
% Development of this work is taking place at
% <https://github.com/komascript/defoldfont>. New issues should be
% reported there as well as known issues can be found.
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, version 1.3c of the license.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.<3c or later is part of all distributions of LaTeX
% version 2005/12/01 or later and of this work.
%
% The Current Maintainer and author of this work is Markus Kohm.
%
% This work consists of the file `defoldfonts.dtx' and `README.md'.
%
% The recommended way to install `defoldfonts' is to use
% the package manager of your TeX distribution.
% ======================================================================
%
%<*dtx>
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
\ProvidesFile{defoldfonts.dtx}
%</dtx>
%<*dtx|package>
%<package>\ProvidePackage{defoldfonts}
[2023-07-28 v1.0
%<dtx> sources and unpack driver of
re-implementation of deprecated KOMA-Script code]
%<package>}
%</dtx|package>
%<*dtx>
\ifx\documentclass\undefined
\input docstrip.tex
\generate{%
\file{defoldfonts.sty}{%
\from{defoldfonts.dtx}{package}%
}%
}%
\else
\let\endbatchfile\relax
\fi
\endbatchfile
\documentclass[ngerman,USenglish]{koma-script-source-doc}
\setcounter{IndexColumns}{2}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=alphabetic]{biblatex}
\begin{filecontents}[force]{\jobname.bib}
@online{pkg:koma-script,
author={Markus Kohm},
version={3.41},
date={2023-07-07},
title={{\KOMAScript} --- A bundle of versatile classes and packages},
url={https://ctan.org/pkg/koma-script},
urldate={2023-07-14},
note={The \KOMAScript{} bundle provides replacements for the \pkg*{article},
\pkg*{report}, and \pkg*{book} classes with emphasis on typography and
versatility. There is also a letter class.},
}
@manual{pkg:koma-script:manual:de,
author={Markus Kohm},
date={2023-06-16},
title={{\KOMAScript}},
subtitle={Die Anleitung},
url={http://mirrors.ctan.org/macros/latex/contrib/koma-script/scrguide-de.pdf},
urldate={2023-07-04},
}
@manual{pkg:koma-script:manual:en,
author={Markus Kohm},
date={2023-06-16},
title={{\KOMAScript}},
subtitle={The Guide},
url={http://mirrors.ctan.org/macros/latex/contrib/koma-script/scrguide-en.pdf},
urldate={2023-07-14},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\setcounter{StandardModuleDepth}{2}
\begin{document}
\nocite{pkg:koma-script,pkg:koma-script:manual:en,pkg:koma-script:manual:de}
\DocInput{defoldfonts.dtx}
\end{document}
%</dtx>
%\fi
%
% \changes{v0.1}{2023/06/01}{start of \KOMAScript{} spin-off}
%
% \GetFileInfo{defoldfonts.dtx}
% \title{Defining Old Font Commands}
% \author{\href{mailto:komascript@gmx.info}{Markus Kohm}}
% \date{Version \filedate{} \fileversion}
% \maketitle
% \begin{abstract}
% The package defines the old font commands \cs{rm}, \cs{sf}, \cs{tt},
% \cs{bf}, \cs{it}, and \cs{sc} that became obsolete with \LaTeXe{} and has
% been removed from the \LaTeX{} kernel. It also defines the old
% \href{https://komascript.de/}{\KOMAScript} font command \cs{sfb}. It can
% be useful if you use a class like the
% \href{https://komascript.de/}{\KOMAScript} classes, which do not define
% the old commands by default, and also an old \BibTeX{} style or package,
% that depends on these commands. However, it should be seen as an emergency
% workaround rather than a solution.
% \end{abstract}
%
% \tableofcontents
%
%\iffalse
%<*doc>
%\fi
\section{What are the possible reasons for using package
\texorpdfstring{\pkg*{defoldfonts}}{defoldfonts} and how to do it?}
\label{sec:reasons}
\DescribeCommand{\rm}%
\DescribeCommand{\sf}%
\DescribeCommand{\tt}%
\DescribeCommand{\bf}%
\DescribeCommand{\it}%
\DescribeCommand{\sl}%
\DescribeCommand{\sc}%
\DescribeCommand{\sfb}%
With \LaTeXe{} in 1994 the font commands of \LaTeX~2.09 became obsolete. These
are not longer defined in the \LaTeX{} kernel. Instead of them, you should use
\cs{rmfamily} resp. \cs{textrm}, \cs{sffamily} resp. \cs{textsf},
\cs{ttfamily} resp. \cs{texttt}, \cs{bfseries} resp. \cs{textbf}, \cs{itshape}
resp. \cs{textit}, \cs{slshape} resp. \cs{textsl}, and \cs{scshape}
resp. \cs{testsc}. The old \href{https://komascript.de/}{\KOMAScript} command
\cs{sfb} should be replaced by a combination of \cs{sf} and \cs{bf}
resp. \cs{textsf} and \cs{textbf}. But unfortunately not only some old
\BibTeX{} styles but even some packages still use these obsolete commands. The
standard classes therefore still define them. The
\href{https://komascript.de/}{\KOMAScript} classes also define them, but only
to show an error message like:
\begin{verbatim}
Class scrartcl Error: undefined old font command `\bf'.
See the scrartcl class documentation for explanation.
Type H <return> for immediate help.
...
l.3 \bf
\end{verbatim}
Within an interactive \LaTeX{} run you can get some more information typing
\texttt{H} and pressing the \texttt{return} key:
\begin{verbatim}
You should note that since 1994 LaTeX2e provides a new font selection scheme
called NFSS2 with several new, combinable font commands. KOMA-Script
classes had defined the old font commands like `\bf' only for compatibility
with old LaTeX 2.09 document styles of Script 2.0. Nevertheless, these
commands are deprecated and undocumented at least since 2003. Since 2013
KOMA-Script classes warned about soon removement of these deprecated commands.
Now, after two decades of LaTeX2e and NFSS2, these commands will not work any
more. If loading a package results in this error message, you should contact
the author of that package and ask him to replace the deprecated font command
`\bf', e.g., by `\normalfont \bfseries `. Otherwise you should reconfigure
or replace the package. If you have used the old font command `\bf' yourself,
you should replace it, e.g., by `\normalfont \bfseries '.
To make it work for now, you can use the already also deprecated class option
`enabledeprecatedfontcommands'.
\end{verbatim}
So to fix the issue, you could load the class with option
\opt{enabledeprecatedfontcommands}. But because this option is also
deprecated, this would result in warning messages like:
\begin{verbatim}
Class scrartcl Warning: deprecated option `enabledeprecatedfontcommands'.
(scrartcl) Note, that this option was already depreacted when
(scrartcl) it has been defined. Support for old font commands
(scrartcl) has been removed from KOMA-Script more than one
(scrartcl) decade ago. It is not recommended to use them any
(scrartcl) longer. Therefore usage of this class option also
(scrartcl) is not recommended.
\end{verbatim}
and:
\begin{verbatim}
Class scrartcl Warning: deprecated old font command `\bf' used.
(scrartcl) You should note, that since 1994 LaTeX2e provides a
(scrartcl) new font selection scheme called NFSS2 with several
(scrartcl) new, combinable font commands. New KOMA-Script classes
(scrartcl) defined the old font commands like `\bf' only for
(scrartcl) compatibility with LaTeX 2.09 document styles of
(scrartcl) Script 2.0. These commands are deprecated and
(scrartcl) undocumented at least since 2003. Since 2013,
(scrartcl) KOMA-Script classes warned about soon removement of
(scrartcl) these deprecated commands. Now, after two decades of
(scrartcl) LaTeX2e, NFSS2, and KOMA-Script these commands will
(scrartcl) not work any longer. If loading a package results in
(scrartcl) this message you should contact the author of that
(scrartcl) package and ask him to replace the depracted font
(scrartcl) command `\bf', e.g., by `\normalfont \bfseries '.
(scrartcl) Otherwise you should reconfigure or replace the
(scrartcl) package. If you have used the old font command
(scrartcl) `\bf' yourself you should replace it, e.g., by
(scrartcl) `\normalfont \bfseries ' on input line ….
\end{verbatim}
As an alternative you can load package \pkg*{defoldfonts}.
The package should be loaded in the preamble using:
\begin{verbatim}
\usepackage{defoldfonts}
\end{verbatim}
Usually the order of \pkg*{defoldfonts} and other packages is irrelevant.
% \iffalse
%</doc>
% \fi
%
% \MaybeStop{\printbibliography[heading=bibintoc]\PrintIndex}
%
% \iffalse
%<*package>
% \fi
% \section{Implementation}
% \label{sec:implementation}
%
% \begin{macrocode}
\ProcessOptions\relax
% \end{macrocode}
%
% \begin{command}{\rm,\sf,\tt,\bf,\it,\sl,\sc,\sfb}
% We define these commands without compromise:
% \begin{macrocode}
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\DeclareOldFontCommand{\sfb}{\normalfont\sffamily\bfseries}{\@nomath\sfb}
% \end{macrocode}
% \end{command}
%
% \iffalse
%</package>
% \fi
%
% \Finale
% \PrintChanges
%
% \endinput
% Local Variables:
% mode: doctex
% ispell-local-dictionary: "en_US"
% eval: (flyspell-mode 1)
% TeX-master: t
% End: