如何在“外部”显示我的表格一个 itemize 结构,以便它将在页面中居中?
我有一个带有逐项结构的文档和一些要在其中显示的表格。它有 3 个子项目,表格位于第三个。
这是一个示例:
\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}
我的问题是,当我生成文档时,表格与前一项对齐,而我希望它在页面中居中。
我尝试在表格之前使用 \end{itemize} 和 \begin{itemize}
,
\end{itemize}
\end{itemize}
\begin{center}
%the table
\end{center}
\begin{itemize}
\begin{itemize}
但我的编译器(pdflatex)在第二个 < 处生成错误“有些问题 - 也许缺少 \item” code>\begin{itemize}
我也尝试使用小型页面
\begin{minipage}[c]{\textwidth}
\end{itemize}
\begin{center}
%the table
\end{center}
\begin{itemize}
\end{minipage}
但没有成功。
所以这是我的问题:
如何在逐项“外部”显示我的表格,以便它将在页面中居中?
提前致谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的第一个策略有效,你只是错过了一个逐项级别(3,而不是2)。
your first strategy works, you just missed one level of itemize (3, not 2).