表格环境中的未对齐列

表格环境中的未对齐列

以下代码:

\documentclass[a4paper]{article}

\usepackage{mwe,array,booktabs}
\usepackage[margin=2cm]{geometry}
\usepackage{caption} 
\captionsetup[table]{skip=5pt}
\usepackage{chemfig, chemformula}
\usepackage{enumitem} % nuevo paquete 07/Feb/2021

\usepackage{fourier,makecell} % Nuevos paquetes 25/Ene/2021
\usepackage{upgreek} % paquete añadido 27/Abr/2021

\begin{document}

\begin{table}[htbp]
  \centering
  \caption{Advantages and disadvantages of synthesis routes to make \ch{TiO_2/Ag} loaded fibers.}
    \begin{tabular}{lp{5.0cm}p{5.0cm}c}
    \toprule
    \textbf{Method} & \textbf{Advantages} & \textbf{Disadvantages}  \\
    \midrule
    Electrospinning & 
    \begin{itemize}[leftmargin=*, nolistsep]
    \item Fast synthesis
    \item Higher porosity and surface area of the synthesized fibers
    \item Relative  control over \ch{TiO_2/Ag} particle loading
    \item Several polymers can be electrospun 
    \item The \ch{TiO_2/Ag} particles are embedded in the polymer matrix
    \item Tunable size and shape of the fibers
    \end{itemize} & 
    \begin{itemize}[leftmargin=*, nolistsep]
    \item Limited amount of polymer to electrospun 
    \item Low solubility of \ch{TiO_2/Ag} particles in the polymer solution to be electrospun 
    \item Specialized equipment
    \end{itemize} \\
    \midrule
    Immersion & 
    \begin{itemize}[leftmargin=*, nolistsep]
    \item Easy and fast method
    \item Good control over the \ch{TiO_2/Ag} particle loading
    \item Low consumption of energy 
    \item Not requires specialized equipment 
    \end{itemize} &
    \begin{itemize}[leftmargin=*, nolistsep]
    \item The polymer support could not be compatible with the \ch{TiO_2/Ag} particles
    \item The polymer support must be functionalized before the immersion
    \item The porosity of the polymer support depends on the supplier
    \item The \ch{TiO_2/Ag} particles are just attached to the surface of the fibers
    \end{itemize} \\
    \midrule
    Hydrothermal & 
    \begin{itemize}[leftmargin=*, nolistsep]
    \item Easy synthesis   
    \item One-step synthesis 
    \end{itemize} &  
    \begin{itemize}[leftmargin=*, nolistsep]
    \item High consumption of energy 
    \item Low control over the \ch{TiO_2/Ag} particle loading
    \item Low production per run
    \item Slow synthesis
    \item Specialized equipment
    \item The \ch{TiO_2/Ag} particles are just attached to the surface of the fibers
    \end{itemize} \\
    \bottomrule
    \end{tabular}%
  \label{tab:comparison_synthesis}%
\end{table}%

\end{document}

提供了图片中显示的表格。如您所见,第一列与其他列对齐不太好。我不知道该如何修复它。有什么建议吗?

在此处输入图片描述

答案1

解决方案是使用以下\compress命令使 Latex 相信在相关列中输入一个单元格时,将开始一个新的小页面:

\documentclass[a4paper]{article}

\usepackage{mwe,array,booktabs}
\usepackage[margin=2cm]{geometry}
\usepackage{caption}
\captionsetup[table]{skip=5pt}
\usepackage{chemfig, chemformula}
\usepackage{enumitem} % nuevo paquete 07/Feb/2021

\usepackage{fourier,makecell} % Nuevos paquetes 25/Ene/2021
\usepackage{upgreek} % paquete añadido 27/Abr/2021

    \makeatletter
        \newcommand*{\compress}{\@minipagetrue}
    \makeatother

\begin{document}

\begin{table}[!htbp]
  \centering
  \caption{Advantages and disadvantages of synthesis routes to make \ch{TiO_2/Ag} loaded fibers.}
    \begin{tabular}{l >{\compress}p{5.0cm}>{\compress}p{5.0cm}c}
    \toprule
    \textbf{Method} & \textbf{Advantages} & \textbf{Disadvantages} \\
    \midrule
    Electrospinning &
    \begin{itemize}[leftmargin=*, nolistsep]
    \item Fast synthesis
    \item Higher porosity and surface area of the synthesized fibers
    \item Relative control over \ch{TiO_2/Ag} particle loading
    \item Several polymers can be electrospun
    \item The \ch{TiO_2/Ag} particles are embedded in the polymer matrix
    \item Tunable size and shape of the fibers
    \end{itemize} &
    \begin{itemize}[leftmargin=*, nolistsep]
    \item Limited amount of polymer to electrospun
    \item Low solubility of \ch{TiO_2/Ag} particles in the polymer solution to be electrospun
    \item Specialized equipment
    \end{itemize} \\
    \midrule
    Immersion &
    \begin{itemize}[leftmargin=*, nolistsep]
    \item Easy and fast method
    \item Good control over the \ch{TiO_2/Ag} particle loading
    \item Low consumption of energy
    \item Not requires specialized equipment
    \end{itemize} &
    \begin{itemize}[leftmargin=*, nolistsep]
    \item The polymer support could not be compatible with the \ch{TiO_2/Ag} particles
    \item The polymer support must be functionalized before the immersion
    \item The porosity of the polymer support depends on the supplier
    \item The \ch{TiO_2/Ag} particles are just attached to the surface of the fibers
    \end{itemize} \\
    \midrule
    Hydrothermal &
    \begin{itemize}[leftmargin=*, nolistsep]
    \item Easy synthesis
    \item One-step synthesis
    \end{itemize} &
    \begin{itemize}[leftmargin=*, nolistsep]
    \item High consumption of energy
    \item Low control over the \ch{TiO_2/Ag} particle loading
    \item Low production per run
    \item Slow synthesis
    \item Specialized equipment
    \item The \ch{TiO_2/Ag} particles are just attached to the surface of the fibers
    \end{itemize} \\
    \bottomrule
    \end{tabular}%
  \label{tab:comparison_synthesis}%
\end{table}%

\end{document} 

在此处输入图片描述

编辑:要删除列表中单元格底部的垂直空间,您可以添加负垂直空间而保留相应的单元格,并用以下内容替换表格序言!

\begin{tabular}{l >{\compress}p{5.0cm}<{\vspace* {-\baselineskip}}>{\compress}p{5.0cm}<{\vspace* {-\baselineskip}}c}

在此处输入图片描述

答案2

我建议你使用枚举项包——具体来说,包的\newlist\setlist宏——创建一个定制的类似于 itemize 的环境(tabitemize下面称为),它会自动将自身封装在minipage环境中,从而让 LaTeX 完成去除垂直空白的工作,否则这些空白会自动插入到“普通”环境的上方和下方itemize。下面的代码还会执行\RaggedRight以暂停窄列中材料的完全对齐。

在此处输入图片描述

\documentclass[a4paper]{article}

\usepackage{mwe,array,booktabs}
\usepackage[margin=2cm]{geometry}
\usepackage{caption} 
\captionsetup[table]{skip=5pt}
\usepackage{chemfig, chemformula}
\usepackage{fourier,makecell} % Nuevos paquetes 25/Ene/2021
\usepackage{upgreek} % paquete añadido 27/Abr/2021

%% New:
\usepackage{ragged2e} % for '\RaggedRight' macro
\usepackage[english]{babel}
\usepackage{enumitem} % for '\newlist' and '\setlist` macros
\newlist{tabitemize}{itemize}{1} % create bespoke one-level itemize-like list
\setlist[tabitemize,1]{leftmargin=*,nolistsep, % <-- as before; next 3 lines are new
                       label=\textbullet,
                       before={\begin{minipage}[t]{\hsize}\RaggedRight},
                       after ={\end{minipage}}}

\begin{document}

\begin{table}[htbp]
  \centering
  \caption{Advantages and disadvantages of synthesis routes 
           to make \ch{TiO_2/Ag} loaded fibers.}
  \label{tab:comparison_synthesis}
  \begin{tabular}{@{} lp{5.0cm}p{5.0cm} @{}}
    \toprule
    \textbf{Method} & \textbf{Advantages} & \textbf{Disadvantages}  \\
    \midrule
    Electrospinning 
    & 
    \begin{tabitemize}
    \item Fast synthesis
    \item Higher porosity and surface area of the synthesized fibers
    \item Relative  control over \ch{TiO_2/Ag} particle loading
    \item Several polymers can be electrospun 
    \item The \ch{TiO_2/Ag} particles are embedded in the polymer matrix
    \item Tunable size and shape of the fibers
    \end{tabitemize} 
    & 
    \begin{tabitemize}
    \item Limited amount of polymer to electrospun 
    \item Low solubility of \ch{TiO_2/Ag} particles in the 
          polymer solution to be electrospun 
    \item Specialized equipment
    \end{tabitemize} \\
    \midrule
    Immersion 
    & 
    \begin{tabitemize}
    \item Easy and fast method
    \item Good control over the \ch{TiO_2/Ag} particle loading
    \item Low consumption of energy 
    \item Not requires specialized equipment 
    \end{tabitemize} 
    &
    \begin{tabitemize}
    \item The polymer support could not be compatible with 
          the \ch{TiO_2/Ag} particles
    \item The polymer support must be functionalized before 
          the immersion
    \item The porosity of the polymer support depends on the supplier
    \item The \ch{TiO_2/Ag} particles are just attached to 
          the surface of the fibers
    \end{tabitemize} \\
    \midrule
    Hydrothermal 
    & 
    \begin{tabitemize}
    \item Easy synthesis   
    \item One-step synthesis 
    \end{tabitemize} 
    &  
    \begin{tabitemize}
    \item High consumption of energy 
    \item Low control over the \ch{TiO_2/Ag} particle loading
    \item Low production per run
    \item Slow synthesis
    \item Specialized equipment
    \item The \ch{TiO_2/Ag} particles are just attached to 
          the surface of the fibers
    \end{tabitemize} \\
    \bottomrule
  \end{tabular}
\end{table}

\end{document}

答案3

使用{NiceTabular}nicematrix您在单元格中没有列表前的空间(但是,您仍然有底部的空间:如果您也想删除它,您应该使用该问题的另一个答案中描述的技术......)。

\documentclass[a4paper]{article}

\usepackage{mwe,array,booktabs}
\usepackage[margin=2cm]{geometry}
\usepackage{caption} 
\captionsetup[table]{skip=5pt}
\usepackage{chemfig, chemformula}
\usepackage{enumitem} % nuevo paquete 07/Feb/2021

\usepackage{fourier,makecell} % Nuevos paquetes 25/Ene/2021
\usepackage{upgreek} % paquete añadido 27/Abr/2021

\usepackage{nicematrix}

\begin{document}

\begin{table}[htbp]
  \centering
  \caption{Advantages and disadvantages of synthesis routes to make \ch{TiO_2/Ag} loaded fibers.}
    \begin{NiceTabular}{lp{5.0cm}p{5.0cm}}
    \toprule
    \textbf{Method} & \textbf{Advantages} & \textbf{Disadvantages}  \\
    \midrule
    Electrospinning & 
    \begin{itemize}[leftmargin=*, nolistsep]
    \item Fast synthesis
    \item Higher porosity and surface area of the synthesized fibers
    \item Relative  control over \ch{TiO_2/Ag} particle loading
    \item Several polymers can be electrospun 
    \item The \ch{TiO_2/Ag} particles are embedded in the polymer matrix
    \item Tunable size and shape of the fibers
    \end{itemize} & 
    \begin{itemize}[leftmargin=*, nolistsep]
    \item Limited amount of polymer to electrospun 
    \item Low solubility of \ch{TiO_2/Ag} particles in the polymer solution to be electrospun 
    \item Specialized equipment
    \end{itemize} \\
    \midrule
    Immersion & 
    \begin{itemize}[leftmargin=*, nolistsep]
    \item Easy and fast method
    \item Good control over the \ch{TiO_2/Ag} particle loading
    \item Low consumption of energy 
    \item Not requires specialized equipment 
    \end{itemize} &
    \begin{itemize}[leftmargin=*, nolistsep]
    \item The polymer support could not be compatible with the \ch{TiO_2/Ag} particles
    \item The polymer support must be functionalized before the immersion
    \item The porosity of the polymer support depends on the supplier
    \item The \ch{TiO_2/Ag} particles are just attached to the surface of the fibers
    \end{itemize} \\
    \midrule
    Hydrothermal & 
    \begin{itemize}[leftmargin=*, nolistsep]
    \item Easy synthesis   
    \item One-step synthesis 
    \end{itemize} &  
    \begin{itemize}[leftmargin=*, nolistsep]
    \item High consumption of energy 
    \item Low control over the \ch{TiO_2/Ag} particle loading
    \item Low production per run
    \item Slow synthesis
    \item Specialized equipment
    \item The \ch{TiO_2/Ag} particles are just attached to the surface of the fibers
    \end{itemize} \\
    \bottomrule
    \end{NiceTabular}%
  \label{tab:comparison_synthesis}%
\end{table}%

\end{document}

您需要多次编译(因为nicematrix在后台使用 PGF/Tikz 节点)。

上述代码的输出

答案4

删除列表前的空格的解决方案是使用V列类型varwidth包中。要删除列表下方的空格,\vspace{-\baselineskip}\mbox{}可以在每个环境后添加该命令itemize(我已将其放在 Bernard 的回答之后的列规范中)。

\documentclass[a4paper]{article}

\usepackage{mwe,array,booktabs}
\usepackage[margin=2cm]{geometry}
\usepackage{caption} 
\captionsetup[table]{skip=5pt}
\usepackage{chemfig, chemformula}
\usepackage{enumitem} % nuevo paquete 07/Feb/2021

\usepackage{fourier,makecell} % Nuevos paquetes 25/Ene/2021
\usepackage{upgreek} % paquete añadido 27/Abr/2021
\usepackage{varwidth}%<--- added

\begin{document}

\begin{table}[htbp]
    \centering
    \caption{Advantages and disadvantages of synthesis routes to make \ch{TiO_2/Ag} loaded fibers.}
    \label{tab:comparison_synthesis}%<---moved here from below
    \begin{tabular}{l *{2}{V{5.0cm}<{\vspace{-\baselineskip}\mbox{}}}}%<---changed
    \toprule
    \textbf{Method} & \textbf{Advantages} & \textbf{Disadvantages}  \\
    \midrule
    Electrospinning 
    & 
    \begin{itemize}[leftmargin=*, nolistsep]
        \item Fast synthesis
        \item Higher porosity and surface area of the synthesized fibers
        \item Relative  control over \ch{TiO_2/Ag} particle loading
        \item Several polymers can be electrospun 
        \item The \ch{TiO_2/Ag} particles are embedded in the polymer matrix
        \item Tunable size and shape of the fibers
    \end{itemize}
    & 
    \begin{itemize}[leftmargin=*, nolistsep]
        \item Limited amount of polymer to electrospun 
        \item Low solubility of \ch{TiO_2/Ag} particles in the polymer solution to be electrospun 
        \item Specialized equipment
    \end{itemize}
    \\
    \midrule
    Immersion 
    & 
    \begin{itemize}[leftmargin=*, nolistsep]
        \item Easy and fast method
        \item Good control over the \ch{TiO_2/Ag} particle loading
        \item Low consumption of energy 
        \item Not requires specialized equipment 
    \end{itemize}
    &
    \begin{itemize}[leftmargin=*, nolistsep]
        \item The polymer support could not be compatible with the \ch{TiO_2/Ag} particles
        \item The polymer support must be functionalized before the immersion
        \item The porosity of the polymer support depends on the supplier
        \item The \ch{TiO_2/Ag} particles are just attached to the surface of the fibers
    \end{itemize}
    \\
    \midrule
    Hydrothermal 
    & 
    \begin{itemize}[leftmargin=*, nolistsep]
        \item Easy synthesis   
        \item One-step synthesis 
    \end{itemize}
    &  
    \begin{itemize}[leftmargin=*, nolistsep]
        \item High consumption of energy 
        \item Low control over the \ch{TiO_2/Ag} particle loading
        \item Low production per run
        \item Slow synthesis
        \item Specialized equipment
        \item The \ch{TiO_2/Ag} particles are just attached to the surface of the fibers
    \end{itemize} 
    \\
    \bottomrule
    \end{tabular}%
\end{table}%
\end{document}

注意:最好将label命令放在命令后面caption。请参阅为什么环境的标签必须出现在标题之后?

在此处输入图片描述

相关内容