Tengo una tabla que hice para mi tesis de maestría y funcionó bien:
Sin embargo, ahora quiero usar esa tabla para un artículo. He copiado el código, pero las viñetas de la segunda columna están demasiado cerca (verticalmente):
¿Alguna idea de cómo puedo solucionar este problema? Probé algunas cosas sugeridas en StackExchange, pero ninguna funcionó. Este es el código para un documento de prueba (donde NO existe el problema):
\documentclass[pdftex,10pt,a4paper]{article}
%Import packages
\usepackage{subfig}
\makeatletter
\newcommand*{\textoverline}[1]{$\overline{\hbox{#1}}\m@th$}
\makeatother
%
\usepackage{ragged2e}
%
\usepackage{color}
\newcommand{\note}[1]{\textcolor{blue}{{#1}}}
\usepackage{colortbl}
\usepackage{booktabs,eqparbox,tabularx}
\usepackage{enumitem}
\begin{document}
\begin{table}[h]
\caption{Implemented methods, and corresponding computed metrics.}
\label{table:computed_metrics}
\small
\renewcommand{\arraystretch}{2}
\setlist[itemize]{nosep,
leftmargin=*,
before=\vspace{-0.6\baselineskip},
after=\vspace{-\baselineskip}
}
\begin{tabular}{ >{\RaggedLeft}p{3.6cm} p{4.2cm} p{5.8cm}}
\hline
\textbf{Method name} & \textbf{Metrics} & \textbf{Method explanation} \\ \hline
\textbf{Simple statistical metrics} & \begin{itemize}
\item Mean
\item Standard deviation (SD)
\end{itemize} & Computes the mean value and the amount of variation (SD) of a feature's time-series. \\
\textbf{Linear variability} & \begin{itemize}
\item Slope of regression ($\alpha$)
\item Median variability ($m$)
\end{itemize} & Calculates the variability of a feature's time-series, and studies how that variability progresses with time (increases [$\alpha>0$], decreases [$\alpha<0$] or maintains [$\alpha=0$]). \\
\textbf{Non-linear variability} & \begin{itemize}
\item Central tendency measurement (CTM)
\end{itemize} & Computes the feature's time-series variability using difference plots. The higher the CTM, the lower the variability, and vice-versa. \\
\textbf{P-wave amplitude dispersion} & \begin{itemize}
\item Amplitude dispersion index (ADI)
\end{itemize} & Quantitative indicator of P-wave morphology variability. The greater the ADI, the greater the variability, and vice-versa. Uses the P-waves' signal. \\
\textbf{Heart rate variability} & \begin{itemize}
\item \textoverline{RR}, SDRR, SDSD, RMSSD, NN20, pNN20, NN50, pNN50
\item TP, VLF, LF, HF, pHF, pLF, LF/HF
\end{itemize}
& Studies the variability of the RR series using metrics from time- and frequency- domain. Gives indications on the autonomic nervous system. \\ \hline
\end{tabular}
\end{table}
\end{document}
No puedo proporcionar un código compilable completo, dado que estoy usando una plantilla del Sensors Journal (https://www.mdpi.com/authors/latex). Sin embargo, puedes descargar mi código compilable completo aquí:https://ufile.io/n7pg8
¡Muchas gracias! diogo
Respuesta1
Pruebe lo siguiente:
\documentclass[journal,article,submit,moreauthors,pdftex,10pt,a4paper]{Definitions/mdpi}
\newcommand*{\textoverline}[1]{$\overline{\hbox{#1}}$} % simplified
%
\usepackage{ragged2e}
\usepackage{booktabs, makecell, tabularx}
\newcolumntype{L}{>{\RaggedRight}X}
\renewcommand\theadfont{\bfseries\normalsize}
\usepackage{enumitem}
\begin{document}
\begin{table}[h]
\caption{Implemented methods, and corresponding computed metrics.}
\label{table:computed_metrics}
\small
\setlist[itemize]{ % nosep, % <--- remove "nosep"
leftmargin=*,
before=\vspace{-0.6\baselineskip},
after=\vspace{-\baselineskip}
}
\setcellgapes{3pt}
\makegapedcells
\begin{tabularx}{\linewidth}{>{\hsize=0.6\hsize\bfseries}L L
>{\hsize=1.4\hsize}L
}
\toprule
Method name & \thead{Metrics} & \thead{Method explanation} \\
\midrule
Simple statistical metrics
& \begin{itemize}
\item Mean
\item Standard deviation (SD)
\end{itemize}
& Computes the mean value and the amount of variation (SD) of a feature's time-series.
\\
Linear variability
& \begin{itemize}
\item Slope of regression ($\alpha$)
\item Median variability ($m$)
\end{itemize}
& Calculates the variability of a feature's time-series, and studies how that variability progresses with time (increases [$\alpha>0$], decreases [$\alpha<0$] or maintains [$\alpha=0$]).
\\
Non-linear variability
& \begin{itemize}
\item Central tendency measurement (CTM)
\end{itemize}
& Computes the feature's time-series variability using difference plots. The higher the CTM, the lower the variability, and vice-versa.
\\
P-wave amplitude dispersion
& \begin{itemize}
\item Amplitude dispersion index (ADI)
\end{itemize}
& Quantitative indicator of P-wave morphology variability. The greater the ADI, the greater the variability, and vice-versa. Uses the P-waves' signal.
\\
Heart rate variability
& \begin{itemize}
\item \textoverline{RR}, SDRR, SDSD, RMSSD, NN20, pNN20, NN50, pNN50
\item TP, VLF, LF, HF, pHF, pLF, LF/HF
\end{itemize}
& Studies the variability of the RR series using metrics from time- and frequency- domain. Gives indications on the autonomic nervous system. \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
El resultado probado al dorso da el siguiente resultado:
En MWE anterior hice algunos cambios fuera de tema que (según mi gusto) hicieron que la tabla fuera más agradable (uso de tabularx
para el entorno de la tabla, makecell
para más espacio vertical encima y debajo del contenido de las celdas).
Apéndice:
Aparentemente, la clase de documento mdpi
tiene una lista codificada itemize
, que se puede sobrescribir con el uso del enumitem
paquete. También parece que, cuando itemize
se usa en la tabla, \parsep
y \itemsep
se reducen.
Una forma de aumentar el espacio vertical entre elementos es agregar \\[1.5ex]
después del final de cada elemento. Con esta solución, ya no necesitará enumetem
el paquete. Entonces, las listas en la tabla se pueden escribir como en MWE arriba, o puede definir un nuevo tipo de columna como se hace en MWE a continuación:
\documentclass[journal,article,submit,moreauthors,pdftex,10pt,a4paper]{Definitions/mdpi}
\newcommand*{\textoverline}[1]{$\overline{\hbox{#1}}$} % simplified
%
\usepackage{ragged2e}
\usepackage{booktabs, makecell, tabularx}
\renewcommand\theadfont{\bfseries\normalsize}
\renewcommand\theadgape{}
\newcolumntype{L}{>{\RaggedRight}X}
\makeatletter
\newcolumntype{I}{>{\minipage[t]{\linewidth}%
\setlength{\leftmargini}{1em}
\itemize%
}L<{\@finalstrut\@arstrutbox\enditemize\endminipage}%
}
\makeatother
\begin{document}
\begin{itemize}
\item Mean
\item Standard deviation (SD)
\end{itemize}
\begin{table}[h]
\caption{Implemented methods, and corresponding computed metrics.}
\label{table:computed_metrics}
\small
\setcellgapes{3pt}
\makegapedcells
\begin{tabularx}{\linewidth}{>{\hsize=0.7\hsize\bfseries}L
I%{\textbullet}
>{\hsize=1.3\hsize}L
}
\toprule
Method name
& \multicolumn{1}{c}{\thead{Metrics}}
& \thead{Method explanation}
\\
\midrule
Simple statistical metrics
& \item Mean\\[1.5ex]
\item Standard deviation (SD)
& Computes the mean value and the amount of variation (SD) of a feature's time-series.
\\
Linear variability
& \item Slope of regression ($\alpha$)\\[.51ex]
\item Median variability ($m$)
& Calculates the variability of a feature's time-series, and studies how that variability progresses with time (increases [$\alpha>0$], decreases [$\alpha<0$] or maintains [$\alpha=0$]).
\\
Non-linear variability
& \item Central tendency measurement (CTM)
& Computes the feature's time-series variability using difference plots. The higher the CTM, the lower the variability, and vice-versa.
\\
P-wave amplitude dispersion
& \item Amplitude dispersion index (ADI)
& Quantitative indicator of P-wave morphology variability. The greater the ADI, the greater the variability, and vice-versa. Uses the P-waves' signal.
\\
Heart rate variability
& \item \textoverline{RR}, SDRR, SDSD, RMSSD, NN20, pNN20, NN50, pNN50\\[1.5ex]
\item TP, VLF, LF, HF, pHF, pLF, LF/HF
& Studies the variability of the RR series using metrics from time- and frequency- domain. Gives indications on the autonomic nervous system. \\
\bottomrule
\end{tabularx}
\end{table}
\end{document}
lo que da: