减少表格内项目的垂直填充

减少表格内项目的垂直填充

我正在使用此代码在表格环境中创建 itemize。

\documentclass[12pt]{extarticle}

\usepackage{geometry}
\usepackage{array}

\begin{document}

\begin{table}
    \centering
    \setlength{\leftmargini}{0.4cm}
    \begin{tabular}{| m{2cm} | m{4cm} | m{4cm} | m{4cm} |}
        \hline
        Verticals & Drivers & Enablers & 5G requirement \\
        \hline
        Education & 
        \begin{itemize} 
            \item Remote delivery 
            \item Immersive experiences 
        \end{itemize} & 
        \begin{itemize} 
            \item Video streaming 
            \item Augmented reality 
            \item Virtual reality 
        \end{itemize} & 
        \begin{itemize} 
            \item Large bandwidth 
            \item Low latency 
        \end{itemize} \\
        \hline
    \end{tabular}
\end{table}

\end{document}

导致了这个

在此处输入图片描述

如您所见,列表开始前和结束之后有大量的垂直空间。

如何获得更紧密的垂直布局?

答案1

enumitem软件包允许您自定义itemize类似环境的几乎所有方面。将这个想法应用于您的格式化目标将产生以下结果:

在此处输入图片描述

\documentclass[12pt]{extarticle}
\usepackage{geometry}
\usepackage{ragged2e} % for '\RaggedRight' macro
\usepackage{enumitem}
\newlist{tabitemize}{itemize}{1} % create a bespoke 1-level itemize-like env.
\setlist[tabitemize]{label=\textbullet, nosep, leftmargin=*, 
                     before={\begin{minipage}[t]{\linewidth}\RaggedRight},
                     after={\end{minipage}}}
\begin{document}

\begin{table}
    \centering
    \begin{tabular}{| p{2cm} | p{4cm} | p{4cm} | p{4cm} |}
        \hline
        Verticals & Drivers & Enablers & 5G requirement 
        \\
        \hline
        Education & 
        \begin{tabitemize}   
            \item Remote delivery
            \item Immersive experiences 
        \end{tabitemize} & 
        \begin{tabitemize} 
            \item Video streaming 
            \item Augmented reality 
            \item Virtual reality 
        \end{tabitemize} & 
        \begin{tabitemize} 
            \item Large bandwidth 
            \item Low latency 
        \end{tabitemize} 
        \\ 
        \hline
    \end{tabular}
\end{table}

\end{document}

相关内容