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 trying to include a enumerate list in an tabularly environment, but the numbering gets wrong when I add more than one level of depth to the list.

\begin{table}[H]
\begin{minipage}{\linewidth}
\setlength{\tymax}{0.8\linewidth}
\centering
\small
\begin{tabulary}{\textwidth}{@{}LL@{}}
Wrong row&
\begin{enumerate}
\item First.
\begin{enumerate}
\item Second
\end{enumerate}
\end{enumerate}\\
\end{tabulary}
\end{minipage}
\end{table}

This code generates the following output for the row:

Wrong row 
           1   1.1 First
                   1.1 Second

If i add another nested level the output gets messy with overlapping numbers.

Outside of any table, enumerate is being working fine thorught all my document.

EDIT:

I have simplified the example to the maximum and I could make it work, think it was the column type, which now is set to P.

\documentclass[11pt]{book}
\begin{document}
\begin{tabular}{|Lp{10cm}|}
    row1&value\\
    row2&
    \begin{enumerate}
        \item First
        \begin{enumerate}
            \item Second
        \end{enumerate}
    \end{enumerate}
\\
\end{tabular}
\end{document}

Which now generates the correct output:

row1     value
row2     1. First
            1.2 Second
share|improve this question
    
Can you turn this into a complete compilable example? Your code as it stands doesn't compile. –  Alan Munn Jul 1 '12 at 12:40
3  
No, make this a complete compilable document (with \documentclass{}\usepackage{}...\begin{document}...\end{document}. Don't post fragments. –  Alan Munn Jul 1 '12 at 13:25
    
Excuse me, I'm new to Latex world. I have corrected the second example and it is working now for me. The problem with first was the column type. –  David Casillas Jul 1 '12 at 16:23
1  
So have you effectively solved your problem? If so, perhaps we should close the question as too localized. (BTW, your sample document still doesn't compile: you haven't defined the L columntype or loaded a package which defines it.) Since you're new, this is one thing you definitely need to get used to. People will be very happy to help you, but you should almost always post complete, compilable documents that show your problem. Sometimes just the process of making one can help you solve things yourself. See this question for more info. –  Alan Munn Jul 1 '12 at 16:29

1 Answer 1

I don't think any of the code fragments that you posted compile however the basic issue is that tabulary enables display math but not other display environments in L columns. A small patch fixes this.

\documentclass{article}
\usepackage{tabulary}

\makeatletter
\let\oldTYtab\TY@tab
\def\TY@tab{\expandafter\TY@xtab\oldTYtab}

\def\TY@xtab#1\bgroup{%
#1\bgroup
\let\list\@gobbletwo
\let\trivlist\relax
\let\endtrivlist\relax
\let\item\relax}

\begin{document}


\noindent
\begin{minipage}{\linewidth}
\setlength{\tymax}{0.8\linewidth}
\small
\noindent
\begin{tabulary}{\textwidth}{@{}LL@{}}
Wrong row&
\begin{enumerate}\item First.
\begin{enumerate}\item Second\end{enumerate}
\end{enumerate}
\end{tabulary}
\end{minipage}

\end{document}
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.