This question already has an answer here:

Here is the code that I have (I have removed parts which I think are not relevant):



% Python style for highlighting

% Python environment

% Python for inline


def function_name():
\caption{Definition of the function_name function.}


What I would like to do is to use the command \pythoninline inside the figure caption argument. This does not work:

\caption{Definition of the \pythoninline{function_name} function.}

Any suggestions would be much appreciated.

marked as duplicate by Werner, Xavier, cmhughes, Gonzalo Medina, T. Verron Jun 21 '13 at 5:13

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.