![对选项“H”使用“float”包但是 KOMA 不喜欢它?](https://linux22.com/image/351383/%E5%AF%B9%E9%80%89%E9%A1%B9%E2%80%9CH%E2%80%9D%E4%BD%BF%E7%94%A8%E2%80%9Cfloat%E2%80%9D%E5%8C%85%E4%BD%86%E6%98%AF%20KOMA%20%E4%B8%8D%E5%96%9C%E6%AC%A2%E5%AE%83%EF%BC%9F.png)
我使用了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”选项与listings
KOMA 中的普通图片/表格一起使用?
祝好,迈克
答案1
你可以加载scrhack
包(作者的KOMA
话)——这使得float
包与类兼容KOMA
。这已经在您在问题中显示的警告消息中提到过(写完答案后看到了这个消息)。
来自文档
其他作者的某些软件包可能与 KOMA-Script 存在问题。我认为有些软件包可以改进。[...] 这意味着,scrhack 重新定义了其他作者软件包的宏!
被黑客入侵的软件包scrhack
hyperref
(,旧版本,请参阅下面的自述文件)float
floatrow
(从来没有听说过)listings
setspace
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