\documentclass{article}
\usepackage{fancyvrb}
\renewenvironment{verbatim}{%
  \verbatimenvironment
  \begin{verbatim}[breaklines,frame=single,gobble=2]%
}{%
  \end{verbatim}%
}
\title{A sample LaTeX document}
\author{Detlef Groth, University of Potsdam}
\date{\today}

\begin{document}

\maketitle

Hello LaTeX!

Here a Tcl example:

\begin{Verbatim}[filter=tcl,label=test,echo=true,eval=true]
puts "Hello Tcl World!"
set x 1
set x
\end{Verbatim}

The value of x is \texttt{tcl set x}!
And here a dot example:

\begin{Verbatim}[filter=dot,eval=true]
digraph g {
  rankdir="LR";
  node[style=filled,fillcolor=skyblue,shape=box];
  A -> B
}
\end{Verbatim}

Now a Pic example:

\begin{Verbatim}[filter=pic,eval=true]
    box wid 1.2 "Hello World!" fill 0.3;
\end{Verbatim}
    
This is some more text.

Let's finish with some ditaa code:

\begin{Verbatim}[filter=puml,eval=true,ext=png]
@startditaa
+---------+           /---------\
|   cEEF  |           |  cFEE   |
|    A    +----->>----+    B    |
|         |           |         |
+---------+           \---------/
@endditaa
\end{Verbatim}

We can as well hide the code and only show the figure by using
\texttt{echo=false} as code chunk argument.

\begin{Verbatim}[filter=puml,eval=true,echo=false]
@startditaa
/---------\           /---------\
|   cEFF  |           |  cFFE   |
|    A    +---<<->>---+    B    |
|         |           |         |
\---------/           \---------/
@endditaa
\end{Verbatim}

\end{document}
