发布时间:2011-06-27 23:07:53
文章类别:表格制作
原文地址:http://blog.sina.com.cn/s/blog_5e16f177010173hw.html

QQ群:91940767/145316219/141877998/80300084/194770436
淘宝店:http://latexstudio.taobao.com
技巧续篇:http://latexstudio.net/
常见数学公式问题集下载

通常,这个方法比较多的,
第一个方法,可以固定列宽然后可以使用列表环境了。
第二个方法,就是使用\parbox。具体实例如下:
\begin{tabular}{|p{3cm}|p{3cm}|}
\hline
\textbf{Name:} Foo &\\
\hline
\textbf{Main success scenario:}& \\
\begin{enumerate}
\item Entry action
\item next steps\ldots
\end{enumerate}&\begin{enumerate}
\item Entry action
\item next steps\ldots
\end{enumerate}\\
\hline
\end{tabular}

\begin{tabular}{|c|c|}
\hline
\textbf{Name:} Foo &\\
\hline
\textbf{Main success scenario:}& \\
\parbox{.25\linewidth}{\begin{enumerate}
\item Entry action
\item next steps\ldots
\end{enumerate}}&\parbox{.25\linewidth}{\begin{enumerate}
\item Entry action
\item next steps\ldots
\end{enumerate}}\\
\hline
\end{tabular}

演示效果:
LaTeX技巧548:表格中如何嵌入description enumerate等环境


前述文章也有定义列格式的方法,这里提供另一个定义方法,
实例如下:
\documentclass{article}
\usepackage{array}
\makeatletter
\newcolumntype{e}[1]{%--- Enumerated cells ---
>{\minipage[t]{\linewidth}%
\NoHyper% Hyperref adds a vertical space
\let\\\tabularnewline
\enumerate
\addtolength{\rightskip}{0pt plus 50pt}% for raggedright
\setlength{\itemsep}{-\parsep}}%
p{#1}%
<{\@finalstrut\@arstrutbox\endenumerate
\endNoHyper
\endminipage}}

\newcolumntype{i}[1]{%--- Itemized cells ---
>{\minipage[t]{\linewidth}%
\let\\\tabularnewline
\itemize
\addtolength{\rightskip}{0pt plus 50pt}%
\setlength{\itemsep}{-\parsep}}%
p{#1}%
<{\@finalstrut\@arstrutbox\enditemize\endminipage}}

\AtBeginDocument{%
\@ifpackageloaded{hyperref}{}%
{\let\NoHyper\relax\let\endNoHyper\relax}}
\makeatother
\begin{document}

\begin{tabular}[t]{|i{2.5cm}|e{3cm}|}
\hline
\item Item A
\item Item B &
\item Item 1
\item Item 2 \\
\hline
\end{tabular}
\end{document}
选自:http://tex.stackexchange.com/questions/11541/how-to-include-enumerate-in-tabular
演示效果:
LaTeX技巧548:表格中如何嵌入description enumerate等环境



点赞(0)

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部