如何在表 4 中放入句子

如何在表 4 中放入句子

我正在关注这个问题的答案如何将句子放入表 3我只是更改了表格的内容。我以为这会很简单,因为我没有触碰那里使用的命令。

发生的情况是,在我更改了表中的句子而不触及用于生成表格的命令之后,PDF 看起来像这样:

在此处输入图片描述

我真的不认为 @ 符号在 Latex 中是一个非常特殊的字符,但为什么电子邮件地址的名称不适合表格呢?如果我要删除电子邮件地址名称中的 @ 符号,该名称刚好适合表格。我不明白。

我用来生成 PDF 的代码如下所示...

\documentclass[a4paper,twocolumn]{article}
\usepackage[margin=1in]{geometry}
\usepackage{multirow,booktabs}
\usepackage{amssymb}
\usepackage{array}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{ragged2e,booktabs,caption}
\usepackage{tabularx}

\setlength\parindent{0pt}
\begin{document}

\begin{table}
\sffamily\small
\setlength{\tabcolsep}{4pt}
\setlength{\extrarowheight}{2pt}
\noindent
\centering
\begin{tabularx}{\textwidth}{|C{3cm}|C{1.5cm-\tabcolsep}|C{1.5cm-\tabcolsep}|X|}
\hline
\multirow{2}{=}[-.5cm]{\centering Email addresses} &                             \multicolumn{2}{C{3cm}|}{Did the information gets posted on the Google Calendar?}  & \multirow{2}{=}[-0.5cm]{\centering Notes}\\
\cline{2-3}
 & Yes & No & \\
\hline
rinshi246\@ gmail.com &  & \checkmark  & The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\hline
[email protected] &  & \checkmark  & The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\hline
[email protected] &  & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\hline
[email protected] &  & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\hline
[email protected] &  & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\hline
[email protected] & \checkmark &  & The information gets posted on Google Calendar.  \\
\hline
[email protected] &  & \checkmark & The information didn't plot on the Google Calendar even if it was a time interval. It should be corrected.  \\
\hline
[email protected] & \checkmark &  & The information gets posted on Google Calendar.  \\
\hline
[email protected] &  & \checkmark & The information didn't plot on the Google Calendar even if it is a weekday and time is mentioned. It should be corrected.  \\
\hline
[email protected] &  & \checkmark & The information didn't plot on the Google Calendar even if the information is enough. The information shown in this context must be recognized by the app and should be corrected.\\
\hline
\end{tabularx}
\caption{Google Calendar's responses to different email accounts.}
\label{table-test6}
\end{table}
\vspace{60mm}


\end{document}

我该如何改正这个问题?

答案1

假设列类型的定义C您之前的查询,我愿提出以下几点建议:

  • 将第一列的列类型从 更改为Cl在电子邮件地址中引入换行符实在是没什么好办法。

  • 从 切换tabletable*

  • 更改\@@排版“at”字符。

  • 由于您正在加载booktabs包,请利用其功能,即,将所有实例替换为、、和\hlinetoprule并且\midrule,删除所有垂直规则。\addlinespace\bottomrule

  • 由于您在表格主体中使用了无衬线字体,我认为在标题中也使用无衬线字体是个好主意。由于您正在加载包caption,因此只需发出一个指令,例如\captionsetup{font=sf}

在此处输入图片描述

\documentclass[a4paper,twocolumn]{article}
\usepackage[margin=1in]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{booktabs,amssymb,array,tabularx}
\usepackage{ragged2e,booktabs,caption}
% see https://tex.stackexchange.com/q/451660/ for def. of "C"
\newcolumntype{C}[1]{>{\Centering\arraybackslash}p{#1}}

\setlength\parindent{0pt}
\begin{document}

\begin{table*} % since 'twocolumn' option is in use
\captionsetup{skip=0.5\baselineskip,font=sf}
\sffamily%\small
\setlength{\tabcolsep}{4pt}
%\setlength{\extrarowheight}{2pt}
%\noindent
%\centering
\begin{tabularx}{\textwidth}{@{} 
         l
         C{\dimexpr1.5cm-\tabcolsep\relax}
         C{\dimexpr1.5cm-\tabcolsep\relax}
         >{\RaggedRight\arraybackslash}X   % left-alignment rather than full justification
         @{}}
\toprule
Email addresses & 
\multicolumn{2}{C{3cm}}{Did information get posted on Google Calendar?}  
& Notes\\
\cmidrule(lr){2-3}
 & Yes & No & \\
\midrule
[email protected] &  & \checkmark  
& The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\addlinespace
[email protected] &  & \checkmark  
& The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\addlinespace
[email protected] &  & \checkmark 
& The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\addlinespace
[email protected] &  & \checkmark 
& The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\addlinespace
[email protected] &  & \checkmark 
& The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\addlinespace
[email protected] & \checkmark &  
& The information gets posted on Google Calendar.  \\
\addlinespace
[email protected] &  & \checkmark 
& The information didn't plot on the Google Calendar even if it was a time interval. It should be corrected.  \\
\addlinespace
[email protected] & \checkmark &  
& The information gets posted on Google Calendar.  \\
\addlinespace
[email protected] &  & \checkmark 
& The information didn't plot on the Google Calendar even if it is a weekday and time is mentioned. It should be corrected.  \\
\addlinespace
[email protected] &  & \checkmark 
& The information didn't plot on the Google Calendar even if the information is enough. The information shown in this context must be recognized by the app and should be corrected.\\
\bottomrule
\end{tabularx}
\caption{Google Calendar's responses to different email accounts.}
\label{table-test6}
\end{table*}

\end{document} 

答案2

您的示例无法编译(C示例中的列类型未定义),并且尺寸似乎未计算。据我所知,您甚至不需要array提供的这种额外的列类型w{x}{l}(它使一个框的对齐方式为 x,宽度为 l,因此w{c}{1.5cm}是一个宽度为 1.5 厘米的框,其内容居中)。我还删除了中间单元格的叠印。

顺便说一句:当您使用时,twocolumn您应该考虑使用,table*因为您的表格对于一列来说太宽了。

桌子

\documentclass[a4paper,twocolumn]{article}
\usepackage[margin=1in]{geometry}
\usepackage{multirow,booktabs}
\usepackage{amssymb}
\usepackage{array}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{ragged2e,caption}
\usepackage{tabularx}

\setlength\parindent{0pt}
\begin{document}

\begin{table}
\sffamily\small
\setlength{\tabcolsep}{4pt}
\setlength{\extrarowheight}{2pt}
\centering
\begin{tabularx}{\textwidth}{|l|wc{\dimexpr1.5cm-\tabcolsep}|wc{\dimexpr1.5cm-\tabcolsep}|X|}
\hline
\multirow{2}{*}{Email addresses} & \multicolumn{2}{>{\centering}p{3cm}|}{Did the information gets posted on the Google Calendar?}  & \multirow{2}{=}{\centering Notes}\\
\cline{2-3}
 & Yes & No & \\
\hline
rinshi246\@ gmail.com &  & \checkmark  & The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\hline
[email protected] &  & \checkmark  & The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\hline
[email protected] &  & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\hline
[email protected] &  & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\hline
[email protected] &  & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar.  \\
\hline
[email protected] & \checkmark &  & The information gets posted on Google Calendar.  \\
\hline
[email protected] &  & \checkmark & The information didn't plot on the Google Calendar even if it was a time interval. It should be corrected.  \\
\hline
[email protected] & \checkmark &  & The information gets posted on Google Calendar.  \\
\hline
[email protected] &  & \checkmark & The information didn't plot on the Google Calendar even if it is a weekday and time is mentioned. It should be corrected.  \\
\hline
[email protected] &  & \checkmark & The information didn't plot on the Google Calendar even if the information is enough. The information shown in this context must be recognized by the app and should be corrected.\\
\hline
\end{tabularx}
\caption{Google Calendar's responses to different email accounts.}
\label{table-test6}
\end{table}
\vspace{60mm}


\end{document}

相关内容