GeneralHow to insert Verbatim environment in \section?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
fractal.generator
Posts: 66
Joined: Tue Oct 07, 2008 9:39 am

How to insert Verbatim environment in \section?

Post by fractal.generator »

Dear all,

I want to insert Verbatim environment in moving arguments such as \section.

Is there a trick to do so?


Thanks in advance.


Hayashi

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

How to insert Verbatim environment in \section?

Post by gmedina »

Hi,

you could use some of the commands provided by the fancyvrb package, as the following example suggests:

Code: Select all

\documentclass{article}
\usepackage{fancyvrb}

\SaveVerb{myverb}|_verbatim%$|

\begin{document}
\tableofcontents

\section{A section title with \protect\UseVerb{myverb}}

\end{document}
Please refer to the package documentation for further information.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply