Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
2  
Please provide more information. Do you have a minimal example of what you've tried so far? What package do you use to show the listings? –  Bruno Mar 31 '11 at 10:05
    
What is a multipage? –  Matthew Leingang Mar 31 '11 at 11:51
    
So, to be clear: you have two listings that are longer than a page, and you want them displayed side-by-side with page breaks? –  Seamus Mar 31 '11 at 17:07
    
@Seamus: exactly:)! –  herdom Mar 31 '11 at 18:00
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
I have tried parallel and parcolumns and they do the trick:). Thank you:)! –  herdom Apr 22 '11 at 14:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.