0

I want the caption of a figure to contain a LaTeX command without it being executed:

enter image description here

Using verbatim environment doesn't work in this case and throws errors. Please suggest a solution to this.

Werner
  • 603,163

1 Answers1

0

A manual solution, which also survives the list of figures:

\documentclass{article}
\begin{document}
\listoffigures
\begin{figure}
  \caption{For example,
    \texttt{\textbackslash include\{data/myNewChapterName.tex\}}}
\end{figure}
\end{document}

Result

Heiko Oberdiek
  • 271,626