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'm using the pdflatex interpreter and trying to get the following behavior using an itemized list in a multicolumn environment:

[space]* item1   *item2
[space]* item3   *item3

I can get somewhat of the behavior I'm looking for using the "enumitem" package, but it breaks for long items.

see this code example:

\documentclass[12pt]{article}
\usepackage{multicol}
\usepackage{enumitem}
\begin{document}
\begin{multicols}{2}
    \begin{itemize}[leftmargin=6em]
        \item Item with lots and lots of text
        \item Another item with lots of text...
    \end{itemize}
\end{multicols}
\end{document}

There's a lot of whitespace and causes items to wrap. I realize that this is because the itemize in the second column also has a left margin of 6em. Anyone have an idea of how to achieve what I'm looking for? anything I've investigated hasn't proven to get it quite right.

I also tried looking at the enumitem documentation: http://www.tex.ac.uk/tex-archive/macros/latex/contrib/enumitem/enumitem.pdf

I've also come across this: columns with itemize but I'd like something a little more flexible and compact

Thanks!

share|improve this question

migrated from stackoverflow.com Jul 7 '11 at 14:23

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

    
I'm pretty sure that the list items won't be arranged horizontally like you want, but rather they'll fill up one column first and then move on to the next. Not sure how you would do what you propose, though, interesting... –  Kerrek SB Jul 6 '11 at 2:56
    
Okay, I flagged it in hopes it will get moved. Thanks! –  user825518 Jul 6 '11 at 18:25
    
Welcome to TeX.sx! Your question got migrated here from a different stackexchange site. Please also register yourself on this site 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. –  Martin Scharrer Jul 7 '11 at 14:32

2 Answers 2

up vote 2 down vote accepted

Perhaps the multienum package could be an option:

\documentclass[12pt]{article}
\usepackage{amssymb} %for \blacksquare
\usepackage{multienum}

\newcommand{\rsqr}{\raisebox{0.4ex}{\tiny $\blacksquare$}}

\newlength\myindent
\newlength\mylen

\renewcommand{\itemxx}[2]{%
  \setlength\mylen{\remainxx}
  \addtolength\mylen{-\myindent}
  \hskip\myindent
  \parbox[t]{\labelwidth}{\hfill\labelenumi}%
  \hskip\labelsep
  \parbox[t]{0.5\mylen}{\raggedright #1}%
  \hfill\parbox[t]{\labelwidth}{\hfill\labelenumi}%
  \hskip\labelsep
  \parbox[t]{0.5\mylen}{\raggedright #2}\smallskip}


\newenvironment{listable}[1][0cm]
  {\begin{multienumerate}
    \setlength\myindent{#1}
    \renewcommand\labelenumi{\rsqr}
    \setlength\itemsep{-.5\baselineskip}
  }
  {\end{multienumerate}}

\begin{document}

\begin{listable}
    \mitemxx{Lots and lots of text, oh my!}{More and more text}
    \mitemxx{word}{All work and no play makes Jack a dull boy}
\end{listable}

\begin{listable}[4em]
    \mitemxx{Lots and lots of text, oh my!}{More and more text}
    \mitemxx{word}{All work and no play makes Jack a dull boy}
\end{listable}

\end{document}

The optional argument of the listable environment controls the indentation from the left margin (default value: 0cm).

enter image description here

share|improve this answer
    
Looks good, I hadn't seen that before. However, how can I get it to indent (see original post). If I add a \leftskip 4em before the clunky tabular solution, I get the desired indentation. I tried adding a [leftmargin=6em] to the multienumerate, but I might be missing something. Thanks! –  zje Jul 29 '11 at 3:53
    
@user825518: see my updated answer; I've added an optional argument allowing you to control the indentation. –  Gonzalo Medina Jul 29 '11 at 14:40

It's kinda sloppy, but this I what I ended up doing - in case anyone stumbles upon this wanting to do something similar.

\documentclass[12pt]{article}
\usepackage{amssymb} %for \blacksquare

%Give a raised square, mimic itemize
\newcommand{\rsqr}{{\raisebox{0.4ex}{\tiny $\blacksquare$}}\hspace{0.5em}}

%Create a fake environment to have similar behavior to itemize
\newenvironment{listable}
{\begin{tabular}{ll}}
{\end{tabular}}

%"item" command
\newcommand{\dblitem}[2]{ \rsqr #1 & \rsqr #2\\}


\begin{document}

\begin{listable}
    \dblitem{Lots and lots of text, oh my!}{More and more text}
    \dblitem{word}{All work and no play makes Jack a dull boy}
\end{listable}

\end{document}

As far as indentation is concerned, since it's a tabular environment, it should maintain the current indentation.

share|improve this answer

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.