Provide a komafont element `verbatim`
KOMA-Script is a bundle of versatile LaTeX classes and packages
Brought to you by:
kohm
The font to be used for verbatim environments (and for verb...) is stored in the LaTeX kernel command \verbatim@font (default is \normalfont\ttfamily). It would be convenient if this font could be set using the komafont mechanism, i.e. with \setkomafont or \addtokomafont. Would it be possible to provide a komafont element verbatim that sets \verbatim@font? (I. e. adding something like
\newcommand*\scr@fnt@verbatim{\verbatim@font}
to the class files, if I understand the implementation correctly).
At first glance, the idea seems tempting. But:
verbatimenvironment is not a KOMA-Script environment but a LaTeX kernel environment.verbatim. I'm not sure, that all of them use\verbatim@font. (To be true: I'm even sure, they do not).fancyvrbuses AFAIK a font setting that cannot be easily reproduced with a single KOMA-Script font element.verbatimhas settings inside the definition of\verbatim@font, that are not font attributes, which are documented to be used with\setkomafontand\addkomafont.So such an element could even be confusing and therefore on closer inspection, however, I think the idea is less good.
Last edit: Markus Kohm 2024-06-13