但是,现在我想将该表格用于文章。我复制了代码,但第二列的项目符号太近了(垂直方向):
有没有什么办法可以解决这个问题?我尝试了 StackExchange 上建议的一些方法,但都没有用。这是测试文档的代码(问题不存在):
\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}
我无法提供完整的可编译代码,因为我使用的是来自 Sensors Journal 的模板(https://www.mdpi.com/authors/latex)。不过,你可以在这里下载我的完整可编译代码:https://ufile.io/n7pg8
非常感谢!Diogo
答案1
请尝试以下操作:
\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}
在背面测试的结果如下:
在上面的 MWE 中,我做了一些题外的改变,这些改变(根据我的喜好)使得表格更美观(用于tabularx
表格环境,makecell
在单元格内容上方和下方获得更多垂直空间)。
附录:
显然,文档类mdpi
有硬编码itemize
列表,可以使用enumitem
包进行覆盖。此外,似乎itemize
在表中使用时,和\parsep
会\itemsep
减少。
增加项目之间垂直空间的一种方法是\\[1.5ex]
在每个项目结束后添加。使用此解决方案,您不再需要enumetem
包装。因此,您可以像上面的 MWE 中一样编写表格中的列表,或者您可以像下面的 MWE 中一样定义新的列类型:
\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}
这使: