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.

I want to make a document with two columns, with each column separate. In other words, I have two separate columns in which I can type, without text flowing from one column to another. My desired use for this is to create 'Questions' on the left column and 'Answers' on the the right column. If there was also a way to align the questions with the corresponding answers, that would be great.

share|improve this question

migrated from stackoverflow.com Nov 5 '11 at 23:39

This question came from our site for professional and enthusiast programmers.

1  
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Nov 6 '11 at 0:54
    
Did you look at Independent left and right columns? –  Ignasi Nov 8 '11 at 9:47
add comment

4 Answers

Parcolumns should work, but you need to wrap each question and answer in an environment to get good spacing:

\documentclass{article}
\usepackage{parcolumns}
\newcommand{\question}[1]{\colchunk{\begin{description}\item[Q:]{#1}%
    \end{description}}}
\newcommand{\answer}[1]{\colchunk{\begin{description}\item[A:]{#1}%
    \end{description}}\colplacechunks}

\begin{document}
\begin{parcolumns}[colwidths={1=2 in},nofirstindent]{2}
%
\question{Lorem ipsum dolor?}
\answer{Sit amet! Consectetur adipiscing elit. Quisque vel ligula nisl.
    Nulla facilisi. Proin tortor turpis, sodales quis porttitor in.}
%
\question{Aliquam condimentum lectus et mauris elementum vitae commodo
    libero aliquet. Integer quis lectus nec nunc viverra tempus?}
\answer{Nunc sit amet sagittis nulla.}
%
\question{Donec vitae nisi eu massa?}
\answer{Only on Tuesdays.}
%
\end{parcolumns}
\end{document}

enter image description here

share|improve this answer
add comment

I've recently run across the paracol package on CTAN. It has some very nice features for synchronizing items in the columns. Here's a working example:

\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{paracol}

\title{Q \& A example}
\author{John Q. Public}
\begin{document}
\maketitle
\begin{paracol}{2}[\section{Part I}]

\subsection*{Question: Age of earth} What is the estimated age of the
earth? Discuss geophysical or astronomical evidence that supports this
estimate.

 \switchcolumn \subsection*{Answer: Age of earth} Current estimate suggest
the age of the earth is approx 4.5 BY. The key evidence for this estimate
includes...

 \switchcolumn \subsection*{Question: Life on earth} What is the current
minimum estimate for how long life has existed on earth? Discuss the
paleontological evidence in support of this estimate...

 \switchcolumn \subsection*{Answer: Life on earth} Current estimates place
the earliest signs of life in rocks of approx 3.8 BYA...

\end{paracol}
\end{document}
share|improve this answer
add comment

Nor sure if I have completely grasped exactly what you need to do...

If you do not need continuous flow of related text over page boundaries, and are using an editor like TeXworks TeX User Group TeXworks Editor ( Development version ) or similar that lets you work with the pdf previewer (Crtl Click in editor text or pdf)—I've use minipage environments for things like that in the past.

It helps also by keeping the distinct text segments positionally related to each other, and the areas can even be positioned, and of different widths.

There are also minipage options available.

\noindent\begin{minipage}{12cm}

blah blah

\end{minipage}
\hspace*{2mm}\begin{minipage}{5.1cm}

Blah blah

\end{minipage}
share|improve this answer
add comment

An ugly solution could also be the following:

\documentclass{report}
\begin{document}
\begin{tabular}{p{0.5\textwidth}p{0.5\textwidth}}
  Question 1
  &
  Answer 1\\

  Question 2
  &
  Answer 2\\
\end{tabular}
\end{document}

It does the wrapping because I set the max width of each column, and the alignment because, well, it's a table.

share|improve this answer
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.