禁止使用 LaTeX 列表包创建的列表标题
我将 LaTeX 与列表包结合使用,并且试图隐藏列表的标题,这样它既不会在实际列表下方也不会在列表列表中查看。
将选项 title
设置为 title=""
或 title=
不起作用。它只会导致列表中的列表被抑制。但是,在第一种情况下,""
显示在列表下方,而在后一种情况中,Listing:
显示在列表下方。
有办法解决这个问题吗?
I'm using LaTeX in conjunction with the listings package and I'm trying to suppress the title of a listing such that it is neither viewed below the actual listing nor in the list of listings.
Setting the option title
to title=""
or title=
does not work. It only leads to the suppression of the listing in the list of listings. However, in the first case ""
is displayed below the listing and in the latter one Listing:
is displayed below the listing.
Is there a way to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个答案是假设您确实希望显示标题。否则,从
lstlisting
环境的可选参数中删除caption
和title
时,我看不到任何问题。使用
caption
包,可以控制与标题一起出现的文本。例如,将其设置为将在使用标题时删除“列表 1:”。
另一方面,如果您不希望列表显示在列表中,则可以将
nolol=true
添加到参数中。希望这些建议能够帮助到您,如果没有帮助,请详细说明您的具体问题。
This answer is under the assumption that you do want a caption to be displayed. Otherwise I can't see any problem in removing both the
caption
and thetitle
from the optional parameters of yourlstlisting
environment.Using the
caption
package, it is possible to control the text that comes together with your caption. For instance setting it towill remove the "Listing 1:" when using a caption.
If on the other hand you don't want a listing to show in your List of listings, you can add
nolol=true
to your parameters.I hope these suggestions can help you, please elaborate on your exact problem if they don't.