![表格中的随机逗号](https://linux22.com/image/441549/%E8%A1%A8%E6%A0%BC%E4%B8%AD%E7%9A%84%E9%9A%8F%E6%9C%BA%E9%80%97%E5%8F%B7.png)
我用 sidewaytable 包制作了一张表格,表格中央有一个奇怪的逗号,不知道它是从哪里来的。有什么想法吗?
%...
\usepackage{array}
\usepackage{longtable}
\usepackage{rotating}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{etoolbox}
\AtBeginEnvironment{tabular}{\sffamily,\footnotesize}
\AtBeginEnvironment{longtable}{\sffamily}
\usepackage[footnotesize,font=sf]{caption}
%...
\begin{sidewaystable}[h!]
\begin{center}
\renewcommand\arraystretch{1.4}
\caption{Adapted from \textcite{Kounadi2020}: Overview of related spatial crime forecasting studies}
\label{tabRelWork}
\begin{tabular} {>{\raggedright}p{2.4cm}>{\raggedright}p{2cm}p{1cm}p{1.5cm}p{1cm}>{\raggedright}p{1.8cm}>{\raggedright}p{1cm}>{\raggedright}p{1.5cm}>{\raggedright}p{1.6cm}>{\raggedright}p{3.5cm}p{1.2cm}}
\toprule
\textbf{Source}& \multicolumn{2}{l}{\textbf{Space}}& \multicolumn{2}{l}{\textbf{Time}}&\multicolumn{2}{l}{\textbf{Crime data}}&\multicolumn{4}{l}{\textbf{Forecasting}}\\
\cmidrule(l{.5em}){2-3} \cmidrule(l{.5em}){4-5} \cmidrule(l{.5em}){6-7} \cmidrule(l{.5em}){8-11}
& \textbf{Study Area} & \textbf{Scale} & \textbf{Sampling period} & \textbf{Months} & \textbf{Type} & \textbf{Samples} & \textbf{Inference} & \textbf{Task} & \textbf{Spatial Unit} & \textbf{Temporal unit}\\
\midrule
\textcite{Brown2001}&Richmond, VA, USA&City&1994–1999&72&Breaking and entering&$ \lessapprox $24.000&Number of crimes&Regression&$\approx0.64mi^{2}$ $(\approx1,65km^{2})$ grid cells&Week, Month\\
\textcite{Cohen2007}&Pittsburgh, PA, USA&City&1991-1998&96&Violent and property&1,3 million&Number of crimes&Regression&$4.000ft$ $(\approx1.220m)$ \newline sq. grid cells&Month\\
\textcite{Dash2018}&Chicago, IL, USA&City&2011–2015&60&34 crime types&6,6 million&Number of crimes&Regression&Communities&Month, Year\\
\textcite{Gorr2003b}&Pittsburgh, PA, USA&City&1991-1998&96&5 crime types&$ \approx $1 million&Number of crimes&Regression&Police precincts&Month\\
\textcite{Ivaha2007}&Cardiff, UK&City&2001-2003&26&Criminal damage&N.A.&\% of crime in clusters&Regression&Clusters of varying size&Month\\
\textcite{Kadar2018}&New York, NY, USA&City&2014–2015&24&All and 5 crime types&174.682&Number of crimes&Regression&Census tract&Year\\
\textcite{Liesenfeld2017}&Pittsburgh, PA, USA&City&2008–2013&72&All crimes&9.936&Number of crimes&Regression&Census tract&Month, Year\\
\textcite{Rentzelos2020}&New York, NY, USA&City&2016&12&All, violent and property&312.403&Hot spots&Regression&Zip codes&Week\\
\textcite{Rodriguez2017}&San Francisco, CA, USA&City&2003–2013&120&Burglary&N.A.&Properties of clusters&Regression&Clusters&Day\\
\textcite{Shoesmith2013}&USA&Country&1960-2009&600&Violent and property&N.A.&Crime rate&Regression&Regions of USA&Year\\
\textcite{Zhao2017}&New York, NY, USA&City&2012-2013&12&N.A.&N.A.&Number of crimes&Regression&$ 2km $ sq. grid cell&Day, Week\\
\textcite{Zhuang2017}&Portland, OR, USA&City&2012-2016&58&All crime&N.A.&Hot spots&Binary classification&$ 600ft $ $(\approx180m)$ \newline sq. grid cells&2 Weeks\\
\bottomrule
\end{tabular}
\end{center}
\end{sidewaystable}
干杯
答案1
参数\AtBeginEnvironment
不是“选项列表”,而只是在适当时间执行的代码。
因此,
\AtBeginEnvironment{tabular}{\sffamily,\footnotesize}
删除逗号并使用
\AtBeginEnvironment{tabular}{\sffamily\footnotesize}
(答案摘自评论)