对选项“H”使用“float”包但是 KOMA 不喜欢它?

对选项“H”使用“float”包但是 KOMA 不喜欢它?

我使用了float图形和表格环境中的可能性“H”包,以便将这些内容准确地放在文本中我想要的位置,而不是 LaTeX 认为更好的位置……:-)

现在,我想使用 KOMA 脚本中的报告类,但是我遇到了这个问题/消息,您可以在那里阅读:KOMA 对 ToC 发出警告

Class scrreprt Warning: \float@addtolists detected!
(scrreprt)              Implementation of \float@addtolist became
(scrreprt)              deprecated in KOMA-Script v3.01 2008/11/14 and
(scrreprt)              has been replaced by several more flexible
(scrreprt)              features of package `tocbasic`.
(scrreprt)              Since Version 3.12 support for deprecated
(scrreprt)              \float@addtolist interface has been
(scrreprt)              restricted to only some of the KOMA-Script
(scrreprt)              features and been removed from others.
(scrreprt)              Loading of package `scrhack' may help to
(scrreprt)              avoid this warning, if you are using a
(scrreprt)              a package that still implements the
(scrreprt)              deprecated \float@addtolist interface .

我如何将此“H”选项与listingsKOMA 中的普通图片/表格一起使用?

祝好,迈克

答案1

你可以加载scrhack(作者的KOMA话)——这使得float包与类兼容KOMA。这已经在您在问题中显示的警告消息中提到过(写完答案后看到了这个消息)。

来自文档

其他作者的某些软件包可能与 KOMA-Script 存在问题。我认为有些软件包可以改进。[...] 这意味着,scrhack 重新定义了其他作者软件包的宏!

被黑客入侵的软件包scrhack

  1. hyperref(,旧版本,请参阅下面的自述文件)
  2. float
  3. floatrow(从来没有听说过)
  4. listings
  5. setspace
  6. lscape

来自自述(2021/06/25 v3.34)

==============================================================================
scrhack - patch some isues with other packages
------------------------------------------------------------------------------
Maintainer:     Markus Kohm
E-Mail:         komascript at gmx info
Abstract:       scrhack is a LaTeX package of the KOMA-Script bundle. It
                patches other packages to make them work better and adds new
                features to improve their interaction with KOMA-Script. One
                main feature is to make them work with tocbasic instead of
                KOMA-Script's deprecated float list interface. Currently,
                patches for float.sty, floatrow.sty, (old versions of)
                hyperref, listings, and setspace are available.
Requires:       scrkbase - internal KOMA-Script package with basics
                tocbasic - features for helper files and float environments
                xpatch - extending etoolbox patching commands
License:        LPPL 1.3c or later
State:          Author maintained
Version:        2021/06/25 v3.34

相关内容