5

The following code:

\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}

provides the table shown in the picture. As you could see, the first column is not well aligned with the others. I cannot figure how to fix it. Any suggestions?

enter image description here

4 Answers4

4

I'd like to suggest that you employ the machinery of the enumitem package -- specifically, the package's \newlist and \setlist macros -- to create a bespoke itemize-like environment (called tabitemize below) which encases itself automatically in a minipage environment, thereby letting LaTeX do the work of getting rid of the vertical whitespace that's otherwise inserted automatically above and below "ordinary" itemize environments. The code below also executes \RaggedRight to suspend full justification of the material in the narrow columns.

enter image description here

\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}

Mico
  • 506,678
4

A solution wirh the \compress command which makes latex believe that entering a cell in the relevant columns, a new minipage is starting:

\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}

enter image description here

Edit: To remove the vertical space at the bottom of cells with lists, you may add a negative vertical space ain leaving the corresponding cells , replacing the table preamble with the following!

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

enter image description here

Bernard
  • 271,350
  • Bonjour, Bernard. Your solution method, which I'll call the implicit-minipage approach, seems not to remove the whitespace at the bottom of the cells. (Compare this to the screenshot that's part of my solution, which uses explicit minipages via a bespoke itemize-like environment.) Do you know how to remove the excess whitespace at the bottom of the columns 2 and 3? By the way, the tabular environment contains just 3 columns; the fourth column, of type c, isn't being used. – Mico Jan 10 '22 at 06:57
  • 1
    @Mico: I've done it long ago, combining a nosep option for the lists and a <{\vskip …}, but I don't have time at the moment to check the exact value. I'll check & edit my answer this afternoon (Paris meridian ;o) – Bernard Jan 10 '22 at 07:38
3

With {NiceTabular} of nicematrix, you don't have the space before the lists in the cells (however, you still have the space at the bottom: if you want to delete it also, you should use a technic described in one of the other answers of this question...).

\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}

You need several compilations (because nicematrix uses PGF/Tikz nodes under the hood).

Output of the above code

F. Pantigny
  • 40,250
0

A solution to remove the whitespace before the list is to use the V column type from the varwidth package. And to remove the whitespace below the list, the command \vspace{-\baselineskip}\mbox{} can be added after every itemize environment (I have put it in the column specification following Bernard's answer).

\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}

Note: It's a good practice to place the label command right after the caption command. See Why does an environment's label have to appear after the caption?.

enter image description here

Imran
  • 3,096