Latex two captioned verbatim environments side-by-side

Posted by egon on Super User See other posts from Super User or by egon
Published on 2010-06-05T11:39:36Z Indexed on 2010/06/05 11:42 UTC
Read the original article Hit count: 303

Filed under:
|
|
|

How to get two verbatim environments inside floats with automatic captioning side-by-side?

\usepackage{float,fancyvrb}
...
\DefineVerbatimEnvironment{filecontents}{Verbatim}%
    {fontsize=\small,
        fontfamily=tt,
        gobble=4,
        frame=single,
        framesep=5mm,
        baselinestretch=0.8,
        labelposition=topline,
        samepage=true}

\newfloat{fileformat}{thp}{lof}[chapter]
\floatname{fileformat}{File Format}

\begin{fileformat}
    \begin{filecontents}
    A  B  C
    \end{filecontents}
    \caption{example.abc}
\end{fileformat}

\begin{fileformat}
    \begin{filecontents}
    C  B  A
    \end{filecontents}
    \caption{example.cba}
\end{fileformat}

So basically I just need those examples to be side-by-side (and keeping automatic nunbering of caption). I've been trying for a while now.

© Super User or respective owner

Related posts about latex

Related posts about tex