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.

I'd like to have footnotes in the caption of listings. I got that working. But the \footnotemark gets shown in the \listoflistings. Normally you can specificly define the text for a caption for the listofXY. But this does not work as I have to give the caption inside of squared brackets. So I cannot use the squared brackets (which usually define the title for the listofXY) here.

Some example code which works:

\begin{lstlisting}[caption={myCaption\protect\footnotemark},label=myLabel]
    // code
\end{lstlisting}
\footnotetext{The text for the footnote}

Does anyone of you have an idea, how I can modify this code snippet to prevent the \footnotemark to be shown in the \listoflistings?

share|improve this question

migrated from stackoverflow.com Mar 3 '12 at 17:01

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

    
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Mar 3 '12 at 17:12

1 Answer 1

up vote 1 down vote accepted

A straightforward hack:

{
\let\footnotemark\relax
\lstlistoflistings
}

This redefines the \footnotemark macro to do nothing within the scope of the list of listings.

share|improve this answer
    
Thanks. That was exactly I was looking for. Putting this around my whole appendix is a nicer solution than the alternative caption for the listings inside the [squared brackets] –  Watnuss Mar 3 '12 at 16:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.