开发者

Supress title of listings created with the LaTeX listings package

I'm using LaTeX in conjunction with the listings package and I'm t开发者_Go百科rying 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?


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 the title from the optional parameters of your lstlisting environment.

Using the caption package, it is possible to control the text that comes together with your caption. For instance setting it to

\captionsetup{labelformat=empty,labelsep=none}

will 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜