Thursday 5 December 2013

[Latex] Math mode in Verbatim or Verb in math mode

Verb in math mode

  • Include
    \usepackage{fancyvrb} % math mode in verbatim
  • SaveVerb to define verb text
    \SaveVerb{verbtext}+verb text+
  • UseVerb
    \UseVerb{verbtext} within math mode

Examples

\usepackage{fancyvrb} % math mode in verbatim
\SaveVerb{verbtext}+verb text+
\begin{align*}
    \UseVerb{verbtext}
\end{align*}

Color the verbatim

Define new blockcode environment

\DefineVerbatimEnvironment{blockcode}
{Verbatim}
{formatcom=\color{blue}}

Examples

\begin{blockcode}
    text to be colored
\end{blockcode}

Break lines in verb

Include this new package: spverbatim

\usepackage{spverbatim} % break lines at spaces when vs. \verb

Use \spverb

\spverb+\langle \listarg \rangle+

Examples

Math in Verbatim

  • TBD

No comments :

Post a Comment