Stream: Archive Mirror: Isabelle Users Mailing List

Topic: [isabelle] Warning: Usage of deprecated font command


view this post on Zulip Email Gateway (Aug 19 2022 at 14:24):

From: Christian Urban <christian.urban@kcl.ac.uk>

From what I can say the warning is correct, though I did not
know it before I just googled for this: There was a decision in
LaTeX2e to replace commands like \rm, \bf, etc by \textrm, \textbf...
and also have new commands \rmfamily, \bfseries etc. The semantic
difference is that \textbf, for example, changes the font to bold
but leaves font settings such as italic or sans serif unchanged. In
contrast \rm would radically change the font to the standard roman font.
If this is wanted, you should have typed \rmfamily to change the font.
You can see the difference if you wanted something like bold and
italic, because both

{\bf\it only italic}
{\it\bf only bold}

do not work, but

\textbf{\textit{bold and italic}}
\textit{\textbf{italic and bold}}

do. Who knew?

Anyway, only very few packages seem to actually complain about
this change (KOMAscript is one of the few) and certainly the "world"
seems to not have noticed nor have cared. It seems, yes the change makes
more sense and is technically more correct, but is still a pain in the
backside writing \textbf{} for {\rm }. But somehow such inflictions on
users sound a tad familiar.....;o)

Hope this helps,
Christian

PS: I googled for

KOMAscript \bf deprecated

and then

\rmfamily \rm Latex2e

to find the relevant info.

view this post on Zulip Email Gateway (Aug 19 2022 at 14:24):

From: Makarius <makarius@sketis.net>
On Wed, 7 May 2014, Joachim Breitner wrote:

Dear developers,

with a current version of KOMAscript, the log is being spammed by many
of messages like this:

*** Class scrartcl Warning: Usage of deprecated font command \bf'! *** (scrartcl) You should note, that in 1994 font command \bf' has
*** (scrartcl) been defined for compatiblitiy to Script 2.0 only.
*** (scrartcl) Now, after two decades of LaTeX2e and NFSS2, you
*** (scrartcl) shouldn't use such commands any longer and within
*** (scrartcl) KOMA-Script usage of \bf' is definitely deprecated. *** (scrartcl) See fntguide.pdf' for more information about
*** (scrartcl) recommended font commands.
*** (scrartcl) Note also, that KOMA-Script will remove the definition
*** (scrartcl) of \bf' anytime until release of about version 3.20. *** (scrartcl) But for now, KOMA-Script will replace deprecated \bf'
*** (scrartcl) by `\normalfont \bfseries ' on input line 48.

The "new" font-selection scheme of LaTeX2e makes me nostalgic, because I
was a young student when that was introduced, and everybody had to study
the manual to see how things are now properly done -- it was generally a
big improvement. IIRC, some compond macros like \rm and \bf where not
really discontinued, but left as useful abbreviations for the longer and
more systematic forms.

What did make a big difference, though, was \emph with its built-in italic
correction, to replace ancient \em. The "new" \emph macros is also the
deeper reason, why the slightly odd mix of text mode and math mode in
Isabelle documentation preparation looks reasonably well: it is used to
let LaTeX insert italic corrections, even if there is not really italic
text.

I am all for removing ancient junk, but I am unsure about the KOMA guy --
he seems to like unconventional things just to be different. The TeX
world is untyped and unscoped, so any real cleanup of old macros is
unrealistic.

I can’t assess if the warning is correct, but would still appreciate if
this could be adjusted in the next Isabelle release.

Just as a general concept, the Isabelle document preparation emits certain
LaTeX sources that probably make sense in many situations. The real
semantics is determined by the collection of style files that are loaded
in root.tex, but this sometimes requires some re-adjustments in the
prelude.

So the easiest way to avoid KOMA complaining could something like

\def\bf{\normalfont\bfseries}

in your root.tex.

Makarius

view this post on Zulip Email Gateway (Aug 19 2022 at 14:25):

From: Makarius <makarius@sketis.net>
Here is also a "proof" from the official latex/base/fntguide.tex:

\begin{decl}
|\DeclareOldFontCommand| \arg{cmd} \arg{text-switch}
\arg{math-switch}
\end{decl}

Declares command \m{cmd} to be a font switch (i.e.~used with the
syntax |{<cmd>...}|) having the definition \m{text-switch}
when used in text and the definition \m{math-switch} when used in a
formula.
Math alphabet commands, like |\mathit|, when used within \m{math-switch}
should not have an argument. Their use in this argument causes their
semantics to change so that they here act as a font switch, as
required by the usage of the \m{cmd}.

This declaration is useful for setting up commands like |\rm| to behave
as they did in \LaTeX~2.09. We strongly urge you \emph{not} to misuse
this declaration to invent new font commands.

This sounds more like "old" in the sense of Isabelle jargon, not "legacy"
nor "obsolete".

Note that \it and \em do make a difference in practice, since they don't
insert italic correction. So {\em bad} will normally look bad, depending
on the surrounding font, the correct form is \emph{good}.

Makarius

view this post on Zulip Email Gateway (Aug 19 2022 at 14:25):

From: Lars Hupel <hupel@in.tum.de>
To add another data point to this discussion:

The document "l2tabu" [0] is a general list of bad practices in LaTeX
2ε and has been around in one way or another for at least ten years (I
remember consulting it heavily when learning LaTeX). Section 2.1.1 also
advises against the use of "old-style" font selection for the reasons
already mentioned in this thread. Interestingly enough, the authors of
this document don't classify it as a deadly sin, but only as a regular
sin.

[0] (German only, unfortunately)
<ftp://ftp.dante.de/tex-archive/info/l2tabu/german/l2tabu.pdf>

view this post on Zulip Email Gateway (Aug 19 2022 at 14:25):

From: Lawrence Paulson <lp15@cam.ac.uk>
In a nutshell, that is exactly why many people switched to the new setup about 10 years ago.

--lcp

view this post on Zulip Email Gateway (Aug 19 2022 at 14:25):

From: Makarius <makarius@sketis.net>
I did not know this document yet, which is indeed quite interesting and
funny, especially concerning the truly deadly sin of a4.sty and
a4wide.sty.

The section 2.1.1 about the "old" font switches conforms to what I have
learned about that 20 years ago, i.e. they are just "old", and only \it
and \em bad in practice, because nobody wants to do italic correction
manually.

Makarius

view this post on Zulip Email Gateway (Aug 19 2022 at 14:25):

From: Andrew Butterfield <Andrew.Butterfield@scss.tcd.ie>

On Wed, 7 May 2014, Lars Hupel wrote:

[0] (German only, unfortunately) <ftp://ftp.dante.de/tex-archive/info/l2tabu/german/l2tabu.pdf>

It's been translated :-)

http://ftp.heanet.ie/pub/CTAN/tex/info/l2tabu/english/l2tabuen.pdf

I did not know this document yet, which is indeed quite interesting and funny, especially concerning the truly deadly sin of a4.sty and a4wide.sty.

Indeed ….


Andrew Butterfield Tel: +353-1-896-2517 Fax: +353-1-677-2204
Lero@TCD, Head of Foundations & Methods Research Group
Director of Teaching and Learning - Undergraduate,
School of Computer Science and Statistics,
Room G.39, O'Reilly Institute, Trinity College, University of Dublin
http://www.scss.tcd.ie/Andrew.Butterfield/


view this post on Zulip Email Gateway (Aug 19 2022 at 14:33):

From: Joachim Breitner <breitner@kit.edu>
Dear developers,

with a current version of KOMAscript, the log is being spammed by many
of messages like this:

*** Class scrartcl Warning: Usage of deprecated font command \bf'! *** (scrartcl) You should note, that in 1994 font command \bf' has
*** (scrartcl) been defined for compatiblitiy to Script 2.0 only.
*** (scrartcl) Now, after two decades of LaTeX2e and NFSS2, you
*** (scrartcl) shouldn't use such commands any longer and within
*** (scrartcl) KOMA-Script usage of \bf' is definitely deprecated. *** (scrartcl) See fntguide.pdf' for more information about
*** (scrartcl) recommended font commands.
*** (scrartcl) Note also, that KOMA-Script will remove the definition
*** (scrartcl) of \bf' anytime until release of about version 3.20. *** (scrartcl) But for now, KOMA-Script will replace deprecated \bf'
*** (scrartcl) by `\normalfont \bfseries ' on input line 48.

I can’t assess if the warning is correct, but would still appreciate if
this could be adjusted in the next Isabelle release.

Thanks,
Joachim
signature.asc


Last updated: Apr 24 2024 at 16:18 UTC