I want the caption of a figure to contain a LaTeX command without it being executed:
Using verbatim environment doesn't work in this case and throws errors. Please suggest a solution to this.
I want the caption of a figure to contain a LaTeX command without it being executed:
Using verbatim environment doesn't work in this case and throws errors. Please suggest a solution to this.
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}
\texttt{\string\include\string{data/myNewChapterName.tex\string}}... – Werner Aug 14 '15 at 16:39\stringwill not survive, when the caption is moved to the.loffile. – Heiko Oberdiek Aug 14 '15 at 16:49\caption[..]{...}since it seemed appropriate in this case (for such a long caption). That is, not include the lengthy bracketed text as part of the.lof-entry. – Werner Aug 14 '15 at 16:50