TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I am working on a C++ reference manual for myself and want good looking listing code blocks.

This stack overflow question was very helpful: LaTeX source code listing like in professional books

But for the life of me I can't find anywhere on the internet for information regarding how to remove the "Listing #" part of the listing captions.

Below is a screenshot of what I have:

enter image description here

I want to remove the front part of the listing caption but still have a caption because i want to say the filename.

share|improve this question

migrated from stackoverflow.com Aug 28 '11 at 20:09

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Jubobs, Werner, Svend Tveskæg, Jesse, Guido Jan 26 '14 at 2:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

I can't answer it fully but the command you are looking for should be \captionsetup.




\begin{lstlisting}[caption = A sample caption]
public void helloWorld(){...


This causes the caption (every caption, listing or not) not to have Listing # (or Figure #, for that matter).

You might want to look into the doc here http://ctan.org/tex-archive/macros/latex/contrib/caption/ to adapt it to you needs. Please post a solution

share|improve this answer

There is also the title option, it is like caption with no number or prefix.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.