Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In my document (KOMA script article) I use the listings package for code listings and the caption package for additional control over captions.

My problem is that some listings flow over multiple pages. When this occurs I would like to have something like "Listing n, continued", or something to that effect at the start of each additional page --- so a contination caption.

I know the captions package supports breaking up captions and doing the "continued" stuff, but am unsure how to get the listings package on board. Any ideas?

share|improve this question

marked as duplicate by Jubobs, Jesse, Peter Jansson, Martin Schröder, Guido Feb 27 at 12:16

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.

add comment

1 Answer

If you don't find a ready-to-use feature here's an approach using the header: right before the long listing you could use \markboth to add the listings name to the header entry. No matter how long the (perhaps external) file is, the header would show the name, perhaps in addition to the section name.

If you like this approach I could create an example.

share|improve this answer
    
This sounds great. A brief example would be appreciated. Do you need to manually 'unmarkboth' after the listing? –  Aaron J Lang May 11 '12 at 20:08
add comment

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