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.

Please take a look on the following example:

\documentclass[a4paper]{article}

\begin{document}
\begin{tabular}{ |p{ \textwidth}| } 

\hline
\begin{enumerate}
    \item Item in a list
\end{enumerate} \\

\hline
Item not in a list \\
\hline
\end{tabular} 
\end{document}

The "Item in a list" has an extra spacing at top and bottom inside a table cell in comparison to "Item not in a list".

How to reduce this top and bottom spacing?

share|improve this question
    
Related Question: Enumerate environment with tabular layout –  Peter Grill Apr 3 '12 at 15:34

2 Answers 2

up vote 3 down vote accepted

Using enumitem:

Taking a hint form Stephan Lehmke, with the enumitem package you could use the inline enumerate* environment (assuming you have a single item):

enter image description here

The enumitem package also includes a resume option which would be useful if you wanted to resume the list in a different row.

References:

Code:

\documentclass{article}
\usepackage[inline]{enumitem}

\begin{document}
\begin{tabular}{ |p{ \textwidth}| }

\hline
\begin{enumerate*}
    \item Item in a list
\end{enumerate*} \\

\hline
Item not in a list \\
\hline
\end{tabular} 
\end{document}

Using a Counter:

Alternatively, you could just use your own counter which yields results identical to above:

\documentclass{article}

\newcounter{MyCounter}%
\newcommand*{\MyItem}{\refstepcounter{MyCounter}\theMyCounter.~}%

\begin{document}
\begin{tabular}{ |p{ \textwidth}| }

\hline
    \MyItem Item in a list\\
\hline
Item not in a list \\
\hline
\end{tabular} 
\end{document}
share|improve this answer

I tried

\usepackage{paralist}

and then

\begin{inparaenum}
\item Item in a list\par
\item Item in a list
\end{inparaenum}\\

The explicit \par looks really weird, but with all other enumerate constructs provided by paralist, the extra spacing was still there.

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.