删除 Latex 表中列表之间的空格

删除 Latex 表中列表之间的空格

我想删除图片上红线所示的空格。我尝试了很多方法,但似乎都行不通。提前谢谢。

\begin{table}[H]
\centerline{
\begin{tabular}{ |p{5cm}||p{2cm}|p{4.5cm}|p{4.5cm}|  }
    \hline
    \multicolumn{4}{|c|}{Competitors for Boredome} \\
    \hline
    Product Name & Price & Advantages & Disadvantages\\
    \hline
    Rendever (Virtual Reality)  & AU\$2064 
    & \begin{itemize} [leftmargin=*, noitemsep] 
        \item Designed for elderly
        \item Reminiscence therapy
        \item Proven 40\% increased happiness
    \end{itemize}
    & \begin{itemize}[leftmargin=*, noitemsep] 
        \item Disorientating
        \item Removes social aspects
    \end{itemize}\\    

    AV1 (Learning Avatar) & AU\$2833 
    & \begin{itemize} [leftmargin=*, noitemsep] 
        \item Students can learn from home
        \item Designed for classrooms
        \item Acts as eyes, ears and voice
    \end{itemize}
    & \begin{itemize}[leftmargin=*, noitemsep] 
        \item Limited target market
        \item May get easily lost 
        \item Dependent on others moving the robot
    \end{itemize}\\

    KOMP (1-button computer) & AU\$1000 
    & \begin{itemize} [leftmargin=*, noitemsep] 
        \item Easy for elderly to use
        \item Reconnect and keep updated with family
    \end{itemize}
    & \begin{itemize}[leftmargin=*, noitemsep] 
        \item Limited target market
        \item Limited functionality
    \end{itemize}\\

    Sony Aibo (Robotic Pet Dog)  & AU\$3000 
    & \begin{itemize} [leftmargin=*, noitemsep] 
        \item Provides distraction
        \item Acts as company
        \item Less mess and responsibilities than a real pet
    \end{itemize}
    & \begin{itemize}[leftmargin=*, noitemsep] 
        \item Doesn't help with social isolation
    \end{itemize}\\

    Social Media (Facebook) & AU\$0 
& \begin{itemize}[leftmargin=*, noitemsep] 
    \item Message, video chat and share photos
\end{itemize}
&\begin{itemize}[leftmargin=*, noitemsep] 
    \item Perceived social interactions
    \item Difficult for some people to use
    \item Requires personal information
\end{itemize}\\

    \hline
\end{tabular}}
\caption{Social Isolation Product Competitors}
\label{tbl:table1}
\end{table}

图片提供

答案1

只需添加选项noitemsep以逐项列出列表,如果仍然不满足于额外的间距,则添加负垂直间距\vspace{-\baselineskip}——表格的示例部分显示在下面的屏幕截图中

在此处输入图片描述

\begin{tabular}{ |p{5cm}||p{2cm}|p{4.5cm}|p{4.5cm}|  }
            \hline
            \multicolumn{4}{|c|}{Competitors for Boredome} \\
            \hline
            Product Name & Price & Advantages & Disadvantages\\
            \hline
            Rendever (Virtual Reality)  & AU\$2064 
            & {\vspace{-\baselineskip}\begin{itemize} [leftmargin=*, noitemsep, topsep=0pt] 
                \item Designed for elderly
                \item Reminiscence therapy
                \item Proven 40\% increased happiness
            \end{itemize}}
            & \begin{itemize}[leftmargin=*, noitemsep, topsep=0pt] 
                \item Disorientating
                \item Removes social aspects
            \end{itemize}\\    

            AV1 (Learning Avatar) & AU\$2833 
            & {\vspace{-\baselineskip}\begin{itemize} [leftmargin=*, noitemsep, topsep=0pt] 
                \item Students can learn from home
                \item Designed for classrooms
                \item Acts as eyes, ears and voice
            \end{itemize}}
            & {\vspace{-\baselineskip}
              \begin{itemize}[leftmargin=*, noitemsep] 
                \item Limited target market
                \item May get easily lost 
                \item Dependent on others moving the robot
            \end{itemize}}\\

            KOMP (1-button computer) & AU\$1000 
            & \begin{itemize} [leftmargin=*, noitemsep] 
                \item Easy for elderly to use
                \item Reconnect and keep updated with family
            \end{itemize}
            & \begin{itemize}[leftmargin=*, noitemsep] 
                \item Limited target market
                \item Limited functionality
            \end{itemize}\\

            Sony Aibo (Robotic Pet Dog)  & AU\$3000 
            & \begin{itemize} [leftmargin=*, noitemsep] 
                \item Provides distraction
                \item Acts as company
                \item Less mess and responsibilities than a real pet
            \end{itemize}
            & \begin{itemize}[leftmargin=*, noitemsep] 
                \item Doesn't help with social isolation
            \end{itemize}\\

            Social Media (Facebook) & AU\$0 
            & \begin{itemize}[leftmargin=*, noitemsep] 
                \item Message, video chat and share photos
            \end{itemize}
            &\begin{itemize}[leftmargin=*, noitemsep] 
                \item Perceived social interactions
                \item Difficult for some people to use
                \item Requires personal information
            \end{itemize}\\

            \hline
    \end{tabular}

答案2

  • 请始终随表格提供完整、可编译的小文档。此类文档在前言中提供有关文档页面布局、使用的相关包等信息,这些信息会影响表格设计。
  • 对于内容只有一行的列,我宁愿使用l和'r'列类型
  • 为了在单元格中获得更多垂直空间,我建议使用包makegapedcells中的宏makecell
  • 我将为表格中的列表\setlist定义通用样式itemize
\documentclass{article}
\usepackage[margin=20mm,
            showframe]{geometry} % in real document remove "showframe" option
\usepackage{ragged2e}
\usepackage{array, makecell}
\usepackage{enumitem}

\begin{document}
    \begin{table}[ht]
\setlist[itemize]{nosep,
                 leftmargin=*,
                 label=\textbullet,
                 after=\end{minipage},                  % <---
                 before=\begin{minipage}[t]{\linewidth} % <---
                 }
\setcellgapes{3pt}
\makegapedcells
\centering
\begin{tabular}{ |l||r|*{2}{>{\RaggedRight}p{4.5cm}|}  }
    \hline
\multicolumn{4}{|c|}{Competitors for Boredome} \\
    \hline
Product Name & Price & Advantages & Disadvantages\\
    \hline
Rendever (Virtual Reality)  & AU\$2064
    &   \begin{itemize}
    \item Designed for elderly
    \item Reminiscence therapy
    \item Proven 40\% increased happiness
        \end{itemize}
        &   \begin{itemize}
        \item Disorientating
        \item Removes social aspects
            \end{itemize}\\
AV1 (Learning Avatar) & AU\$2833
    &   \begin{itemize}
    \item Students can learn from home
    \item Designed for classrooms
    \item Acts as eyes, ears and voice
        \end{itemize}
        &   \begin{itemize}
        \item Limited target market
        \item May get easily lost
        \item Dependent on others moving the robot
            \end{itemize}\\
KOMP (1-button computer) & AU\$1000
    &   \begin{itemize}
    \item Easy for elderly to use
    \item Reconnect and keep updated with family
        \end{itemize}
        &   \begin{itemize}
        \item Limited target market
        \item Limited functionality
            \end{itemize}\\
Sony Aibo (Robotic Pet Dog)  & AU\$3000
    &   \begin{itemize}
    \item Provides distraction
    \item Acts as company
    \item Less mess and responsibilities than a real pet
        \end{itemize}
        &   \begin{itemize}
        \item Doesn't help with social isolation
            \end{itemize}\\
Social Media (Facebook) & AU\$0
    &   \begin{itemize}
    \item Message, video chat and share photos
\end{itemize}
    &   \begin{itemize}
    \item Perceived social interactions
    \item Difficult for some people to use
    \item Requires personal information
        \end{itemize}\\
    \hline
\end{tabular}
    \caption{Social Isolation Product Competitors}
\label{tbl:table1}
    \end{table}
\end{document}

在此处输入图片描述

题外话:您可以考虑以下表格设计:

\documentclass{article}
\usepackage[margin=20mm]{geometry} % in real document remove "showframe" option
\usepackage{ragged2e}
\usepackage{booktabs, makecell, tabularx}
\usepackage{enumitem}

\begin{document}
    \begin{table}[ht]
\setlist[itemize]{nosep,
                 leftmargin=*,
                 label=\textbullet,
                 after=\end{minipage},                  % <---
                 before=\begin{minipage}[t]{\linewidth} % <---
                 }
\setcellgapes{3pt}
\makegapedcells
\centering
\begin{tabularx}{\linewidth}{@{} l r *{2}{>{\RaggedRight}X} @{}}
    \toprule
\multicolumn{4}{c}{Competitors for Boredome} \\
    \midrule
Product Name & Price & Advantages & Disadvantages\\
    \midrule
Rendever (Virtual Reality)  & AU\$2064
    &   \begin{itemize}
    \item Designed for elderly
    \item Reminiscence therapy
    \item Proven 40\% increased happiness
        \end{itemize}
        &   \begin{itemize}
        \item Disorientating
        \item Removes social aspects
            \end{itemize}\\
AV1 (Learning Avatar) & AU\$2833
    &   \begin{itemize}
    \item Students can learn from home
    \item Designed for classrooms
    \item Acts as eyes, ears and voice
        \end{itemize}
        &   \begin{itemize}
        \item Limited target market
        \item May get easily lost
        \item Dependent on others moving the robot
            \end{itemize}\\
KOMP (1-button computer) & AU\$1000
    &   \begin{itemize}
    \item Easy for elderly to use
    \item Reconnect and keep updated with family
        \end{itemize}
        &   \begin{itemize}
        \item Limited target market
        \item Limited functionality
            \end{itemize}\\
Sony Aibo (Robotic Pet Dog)  & AU\$3000
    &   \begin{itemize}
    \item Provides distraction
    \item Acts as company
    \item Less mess and responsibilities than a real pet
        \end{itemize}
        &   \begin{itemize}
        \item Doesn't help with social isolation
            \end{itemize}\\
Social Media (Facebook) & AU\$0
    &   \begin{itemize}
    \item Message, video chat and share photos
\end{itemize}
    &   \begin{itemize}
    \item Perceived social interactions
    \item Difficult for some people to use
    \item Requires personal information
        \end{itemize}\\
    \bottomrule
\end{tabularx}
    \caption{Social Isolation Product Competitors}
\label{tbl:table1}
    \end{table}
\end{document}

在此处输入图片描述

相关内容