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 have tried finding the answer on google but to no avail, hence here.

I have a multicolumn list in my latex file.

\begin{multicols}{3}
\begin{itemize}
\item blah1
\item blah2 blah3 blah4
\item blah5 blah6

\end{itemize}
\end{multicols}

So right now it automatically formats my multicolumn as -

blah1 and blah2 in column1, blah3 and blah4 in column2 and remaining in column3.

however I want each item to be in its own column, so blah1 goes into column1, "blah2 blah3 blah4" goes into column2, and "blah5 blah6" go in column3.

How do I achieve this?

share|improve this question
1  
Wouldn't this be simpler in a table? Alternatively, you could add \columnbreak at the end of each item. –  Alan Munn Aug 1 '13 at 18:41
    
I dont think so. Say I want to say "I am Tofu King" in column 1, "I am here for help" in column 2 and "This is my first question" in column 3. so whenever I would need to give a line break, I would have to break each of the itemized sentences apart and then "&" them to appear in next line. –  Tofu King Aug 1 '13 at 18:45
    
So try the \columnbreak solution then. –  Alan Munn Aug 1 '13 at 18:46
    
This takes away the luxury of constantly being able to change the sentences when in need. –  Tofu King Aug 1 '13 at 18:46
    
aah, columnbreak worked. Thanks! I am new to it..so..thanks again! –  Tofu King Aug 1 '13 at 18:47
show 1 more comment

1 Answer

Here's a solution that works by appending \columnbreak to each item. Note that this will not work if you have more items than columns, since subsequent column breaks will produce page breaks, which is not what you want. Rather than add \columnbreak manually to each item, I've wrapped it in a command and then used enumitem to redefine the \item command locally within the list. Since three column text produces quite nasty looking text when fully justified, I've added \RaggedRight (from the ragged2e package) which will do a nicer job of formatting the narrow columns.

\documentclass{article}
\usepackage{multicol}
\usepackage{ragged2e}
\usepackage{enumitem}
\usepackage{etoolbox}
% define a new command identical to \item
\let\colitem\item
% append \columnbreak to the new item command
\apptocmd{\colitem}{\columnbreak}{}{}
\begin{document}
% If you don't use the multicols* environment and have more items than columns
% you will get an error.  
\begin{multicols*}{3}
% Now using enumitem's "before" key, we make the list RaggedRight and redefine
% \item locally to mean \colitem
\begin{itemize}[before={\RaggedRight\let\item\colitem}]
\item This is the first item.
\item This is a longer sentence to see how it wraps.
\item This is the third item.
%\item With this scheme you can't have more items than columns (uncomment to see)
\end{itemize}
\end{multicols*}
\end{document}

output of code

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.