tags:

views:

303

answers:

3

Say I have a list of words that need to retain their order, and need to be sorted into two columns.

I can do this rather well with a tabular:

\begin{tabular}{l l}
abc & def \\
ghi & jkl \\
\end{tabular}

But doing so makes it rather difficult and time consuming to reorder the list.

Is it possible to have an automatically wrapped two-column list? Ideally, I would like to simply enter an ordered list:

\begin{magic}
abc \\
def \\
ghi \\
jkl \\
\end{magic}

And have it wrapped to two columns (as the tabular enables):

abc  def
ghi  jkl
A: 

You might be better off with creating the table in some other program and using a script or export function to convert it to a LaTeX table. The longtable package will allow that table to wrap across multiple pages.

Seth Johnson
I don't like the idea of having to run a script every time I add a new item to the list.Also, the idea here is ease of addition and reordering. It's tedious to do either with tables.
plash
+1  A: 

Try the multicol environment. Not sure if this is what you want, but

\begin{multicols}{2}
\begin{itemize}
\item abc
\item def
% etc
\end{itemize}
\end{multicols}

will wrap the list into two cols. You need to \usepackage{multicol} i think, but it might be multicols. I should also note that you can use \begin{multicols*}{2} to create similar environment, but with a different property: \begin{multicols} creates columns and balances them equally, but \begin{multicols*} creates columns and fills the first before going to the second (so won't always be 'balanced', which is more ideal for papers).

awegawef
This works well(ish) for the original ordering (which I changed to right-to-left).Do you know if there's a way to remove the bullet points (without doing '\item[] blah' every time) and the whitespace surrounding the items? Or how to order them right-to-left instead of top-bottom?
plash
@plash: You can eliminate the bullet using `\renewcommand{\labelitemi}{\hskip-1em}` (adjust dim to your taste).
Charles Stewart
+1  A: 

Second attempt, tested:

\def\word{\let\word\rightword \message{First}}
\def\leftword{\\ \let\word\rightword \message{Left}}
\def\rightword{\> \let\word\leftword \message{Right}}
\begin{tabbing}
\hskip 3in \=\\
% Items
\word One
\word Two
\word Three
\end{tabbing}

This version is indeed ugly. A negative vskip after the \\ in the tabbing env would be a good thing. This can be adapted to use the \\s in your 'magic' environment.

Charles Stewart
I can't get this to work. Here's the error with the original: http://latex.pastebin.com/DuE4tpQcAnd here's my edited version and the errors that come with it: http://latex.pastebin.com/NVABkQTc
plash
Charles Stewart
Excellent! Thank you.
plash
Hmm. This has issues with long words/definitions. It seems each item needs to be encased in another box or something to do wrapping.. Though it still works rather well and I can change the definitions to fit it.
plash