tags:

views:

122

answers:

1

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?

+2  A: 

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.

Pieter
Setting nolol=true and not setting the options title or caption, respectively, does the trick. Thanks a lot.
t6d