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.

The MWE below indicates the problem. The final item, number 6, isn't aligned correctly (it is pushed some extra space to the right!). This is also the case when I change the number of tabs to 2.

\documentclass{article}
\usepackage[inline,shortlabels]{enumitem} 
\usepackage{tabto}

\begin{document}

\NumTabs{3}
\begin{description*}[before={\noindent},itemjoin={\tab}]
\item {1.} 
\item {2.} 
\item {3.} 
\item {4.} 
\item {5.} 
\item {6.} 
\end{description*}

\end{document}
share|improve this question
    
You may want to have a look at the tasks package (part of exsheets). My answer to How can I make two columns in two columns shows an example. –  cgnieder Jan 12 at 20:03
add comment

2 Answers

up vote 6 down vote accepted

Insert after={\hfill} in the description* options.

MWE

\documentclass{article}
\usepackage[inline,shortlabels]{enumitem}
\usepackage{tabto}

\begin{document}

\NumTabs{3}
\begin{description*}[before={\noindent},itemjoin={\tab},after={\hfill}]
\item {1.}
\item {2.}
\item {3.}
\item {4.}
\item {5.}
\item {6.}
\end{description*}

\end{document}

Output:

enter image description here


EDIT

To be able to do what you ask in the comment, we need to issue \hfill\par before the closing brace, otherwise the paragraph is not ended. For explanations see, for example, Incorrect line spacing when using \Large in a center environment.

This can be done with the help of the etoolbox package and the line

\AfterEndEnvironment{description*}{\hfill\par}

that adds \hfill\par after description* has ended.

MWE:

\documentclass{article}
\usepackage[inline,shortlabels]{enumitem}
\usepackage{tabto}
\usepackage{etoolbox}
\AfterEndEnvironment{description*}{\hfill\par}

\begin{document}

{\tiny\NumTabs{3}
\begin{description*}[before={\noindent},itemjoin={\tab},after={\hfill}]
\item {1.}
\item {2.}
\item {3.}
\item {4.}
\item {5.}
\item {6.}
\end{description*}}
\bigskip

\NumTabs{3}
\begin{description*}[before={\noindent},itemjoin={\tab},after={\hfill}]
\item {1.}
\item {2.}
\item {3.}
\item {4.}
\item {5.}
\item {6.}
\end{description*}
\bigskip

{\Huge\NumTabs{3}
\begin{description*}[before={\noindent},itemjoin={\tab},after={\hfill}]
\item {1.}
\item {2.}
\item {3.}
\item {4.}
\item {5.}
\item {6.}
\end{description*}}

\end{document} 

Output:

enter image description here

share|improve this answer
    
This works! When I then wrapped a {\tiny ...} around it all, that is: {\tiny\NumTabs{3}...\end{description*}}, again I get strange behaviour with the final \item. –  Geoff Jan 12 at 21:18
    
@Geoff I've added a workaround. –  karlkoeller Jan 13 at 8:49
    
Many thanks, it works a treat! –  Geoff Jan 13 at 9:07
add comment

An alternative to an enumerated list in two or three columns is the multienum package:

\documentclass{article}
\usepackage{multienum}
\begin{document}

\begin{multienumerate}
\mitemxxx{One}{Two}{Three}
\mitemxxx{Four}{Five}{Six}
\end{multienumerate}

\end{document}

MWE

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.