I load some code to my document like this: \lstinputlisting{MergeSort.txt}. This works perfectly, however I would like to add a caption in footnotesize to the bottom of the source code (without any tag like 'Listing 1:'). How can I do this?


1 Answer 1


Use the title key-value option for listings:

enter image description here

This is a merge sort algorithm



\lstinputlisting[captionpos=b,title={\footnotesize Merge Sort}]{MergeSort.txt}


title positioning is adjusted using captionpos.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .