2

Could you tell me what should I do to be able to insert multipages, side by side listings in Latex document?

I have already tried with \begin{minipage}, but it doesn't work with multipages.

EDIT: @Matthew Leingang: by multipages I mean listings in verbatim environment which don't fit into one page.

This is my preamble:

\documentclass[a4paper,11pt]{article}
\usepackage[utf8x]{inputenc}    
\usepackage[pdftex]{graphicx}
\usepackage{indentfirst}

\setlength{\textheight}{24cm}
\setlength{\textwidth}{15.92cm}
\setlength{\footskip}{10mm}
\setlength{\oddsidemargin}{0mm}
\setlength{\evensidemargin}{0mm}
\setlength{\topmargin}{0mm}
\setlength{\headsep}{5mm}

\makeatletter 
\def\thesection{\arabic{section}.}
\def\thesubsection{\thesection\arabic{subsection}}
\makeatother

\usepackage{amsmath}
\usepackage{amssymb}

\usepackage[pdfpagemode=None,bookmarksopen=false,colorlinks=true,linkcolor=blue]{hyperref}

I would like to add Python listings, two, side by side. I have already tried something like this:

\begin{figure}[ht]
\begin{minipage}[b]{0.5\linewidth}
\centering
\begin{verbatim}
%many lines with Python code
\end{verbatim}
\caption{default}
\end{minipage}
\hspace{0.5cm}
\begin{minipage}[b]{0.5\linewidth}
\centering
\begin{verbatim}
%many lines with Python code
\end{verbatim}
\caption{default}
\end{minipage}
\end{figure}

but above code doesn't work with listings that are longer than one page.

Caramdir
  • 89,023
  • 26
  • 255
  • 291
herdom
  • 23

1 Answers1

1

I found three packages for that, and all display text side-by-side:

  • parallel
  • parcolumns
  • ledmac/ledpar

I tried all of them with Java code (in verbatim environment) and they basically do what they should. Four page Java code displayed side-by-side.

Warning: all of the packages are not perfect in my opinion and have issues. If they fit your needs or not you could decide by the documentation that comes with them.

BernS
  • 398