tags:

views:

11

answers:

1

Hi all,

I have a document with an itemize structure and some table to display inside it. It have 3 subitem and the table is in the third one.

Here is an example:

\documentclass{article}%
\usepackage{amsmath}%
\usepackage{amsfonts}%
\usepackage{amssymb}%
\usepackage{graphicx}

\begin{document}
\begin{itemize}
  \item Item1
  \begin{itemize}
    \item Subitem1
    \begin{itemize}
      \item Subsubitem1
\begin{center}
\begin{tabular}{ |l|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c| }
\hline
S & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 17 & 18 & 19 & 20 & 21 & 22 & 23 & 24 & 25 & 26 & 27 & 28 \\
\hline
B & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 &  1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\hline
H & \multicolumn{4}{c|}{F} & \multicolumn{4}{c|}{0} &  \multicolumn{4}{c|}{F} & \multicolumn{4}{c|}{0} & \multicolumn{4}{c|}{0} \\
\hline
\end{tabular}
\end{center}    
      \item Subsubitem2
    \end{itemize}
    \item Subitem2
  \end{itemize}
  \item Item2
\end{itemize}   
\end{document}

My problem is, when I generate my document the table is aligned with the previous item while I would like it to be centered in the page.

I tried using \end{itemize} before the table and \begin{itemize} like that

\end{itemize}
\end{itemize}
\begin{center}
    %the table
\end{center}
\begin{itemize}
\begin{itemize}

but my compiler (pdflatex) generates an error "Something's wrong--perhaps a missing \item" at the second \begin{itemize}

I also tried to use a minipage

\begin{minipage}[c]{\textwidth}
\end{itemize}
\begin{center}
    %the table
\end{center}
\begin{itemize}
\end{minipage}

But with no more success.

So here is my question:

How to display my table "outside" the itemize so it will be centered in the page?

Thanks in advance

A: 

your first strategy works, you just missed one level of itemize (3, not 2).

\begin{document}
\begin{itemize}
  \item Item1
  \begin{itemize}
    \item Subitem1
    \begin{itemize}
      \item Subsubitem1
    \end{itemize}
  \end{itemize}
\end{itemize}

\begin{center}
[table]
\end{center}    

\begin{itemize}
  \item[] % we need an item here so make one with no bullet
  \begin{itemize}
    \item[] % as above
    \begin{itemize}
      \item Subsubitem2
    \end{itemize}
    \item Subitem2
  \end{itemize}
  \item Item2
\end{itemize}   
\end{document}
second
Yes sorry I forgot the third itemize when I made the example. But as I said in my question I have the error "Something's wrong--perhaps a missing \item" when I use this technique. Probably because there is no "\item" between two "\begin{itemize}"
RenardNoir
It worked fine when I compiled (with the table code). Did you have more code when you compiled?
second
No I do not have more code. But I have just noticed that even with this error, a PDF file is generated with the table at the expected place. Why do I have an error if it works? It should be just a Warning.
RenardNoir
ah, didn't notice the error. it seems latex requires an item for any contents, so added \item[] in the code re-initialising the itemize. [] hides the bullet. hade updated the code. compiles without errors now
second
Yes it works perfectly. I didn't know it was possible to hide a bullet. Thank you very much.
RenardNoir