我正在关注这个问题的答案如何在表格中放入句子 2我只是更改了表格的内容。我以为这会很简单,因为我没有触碰那里使用的命令。
发生的情况是,在我更改了表中的句子而不触及用于生成表格的命令之后,PDF 看起来像这样:
这是我用来制作上述表格的命令:
\documentclass[a4paper,twocolumn]{article}
\usepackage[margin=1in]{geometry}
\usepackage{calc}
\usepackage{amssymb}
\usepackage{array}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tabularx,ragged2e,multirow,booktabs}
\renewcommand\tabularxcolumn[1]{C{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\setlength\parindent{0pt}
\begin{document}
\begin{table}
\sffamily\small
\setlength{\tabcolsep}{4pt}
\setlength{\extrarowheight}{2pt}
\noindent
\centering
\begin{tabularx}{\linewidth}{|X|C{1cm-\tabcolsep}|C{1cm-\tabcolsep}|c|}
\hline
\multirow{6}{=}{\centering Appointment--related information} & \multicolumn{2}{C{2cm}|}{Did the information gets posted on the Google Calendar?} & \multirow{6}{*}{\centering Notes}\\
\cline{2-3}
& Yes & No & \\
\hline
I have an appointment at 8. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Meeting at 10. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Family trip on August 5 at 6. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Drink medicine at 8 o'clock. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Project defense at 8. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
I have an appointment at 10 pm. & \checkmark & & The information gets posted on Google Calendar. \\
\hline
Meeting from 10 pm to 12 am. & & \checkmark & The information didn't plot on the Google Calendar even if it was a time interval. It should be corrected. \\
\hline
Project defense at 8 am. & \checkmark & & The information gets posted on Google Calendar. \\
\hline
Date on Friday at 7 pm. & & \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
Watching movies with friends at 10 o'clock in the evening. & & \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}
\label{tab:tab1}
\caption{Google Calendar's responses to different appointment--related informations.}
\end{table}
\end{document}
我不明白我错在哪里。我该如何纠正这个问题,让桌子再次变得有吸引力?
答案1
我已经替换\linewidth
为\textwidth
表格型 环境并对列长度进行一些其他设置。
\documentclass[a4paper,twocolumn]{article}
\usepackage[margin=1in]{geometry}
\usepackage{calc}
\usepackage{amssymb}
\usepackage{array}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tabularx,ragged2e,multirow,booktabs}
\renewcommand\tabularxcolumn[1]{C{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\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 Appointment--related information} & \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
I have an appointment at 8. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Meeting at 10. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Family trip on August 5 at 6. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Drink medicine at 8 o'clock. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Project defense at 8. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
I have an appointment at 10 pm. & \checkmark & & The information gets posted on Google Calendar. \\
\hline
Meeting from 10 pm to 12 am. & & \checkmark & The information didn't plot on the Google Calendar even if it was a time interval. It should be corrected. \\
\hline
Project defense at 8 am. & \checkmark & & The information gets posted on Google Calendar. \\
\hline
Date on Friday at 7 pm. & & \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
Watching movies with friends at 10 o'clock in the evening. & & \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}
\label{tab:tab1}
\caption{Google Calendar's responses to different appointment--related informations.}
\end{table}
\end{document}
答案2
最后一列应该是一X
列,字体大小应该\footnotesize
适合页面高度。除了一些改进之外,我提出了另一种解决方案:使用包cuted
使表格分布在整个文本宽度上,这样就可以使用正常的字体大小。你不能在里面有浮动cuted
,所以你必须使用\captionof
命令。以下是两种方法的代码:
\documentclass[a4paper,twocolumn]{article}%
\usepackage[margin=1in, showframe]{geometry}
\usepackage{calc}
\usepackage{amssymb}
\usepackage{array}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tabularx, ragged2e, multirow, booktabs}
\renewcommand\tabularxcolumn[1]{C{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\setlength\parindent{0pt}
\usepackage{cuted, caption, lipsum}
\newcommand{\nl}{\newline}
\begin{document}
\begin{table}[!htb]
\sffamily\footnotesize
\setlength{\tabcolsep}{4pt}
\setlength{\extrarowheight}{2pt}
\noindent
\centering
%\begin{tabularx}{\linewidth}{|X|C{1cm-\tabcolsep}|C{1cm-\tabcolsep}|c|}
\begin{tabularx}{\linewidth}{|C{22mm}|C{1cm-\tabcolsep}|C{1cm-2\tabcolsep}|X|}
\hline
\multirow{6}{=}{\centering Appointment-related information} & \multicolumn{2}{C{2cm}|}{Did the information get posted on the Google Calendar?} & \multirow{6}{*}{\centering Notes}\\
\cline{2-3}
& Yes & No & \\
\hline
I have an appointment\nl at 8. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Meeting at 10. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Family trip \nl on August 5 \nl at 6. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Drink medicine \nl at 8 o'clock. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Project defense\nl at 8. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
I have an appointment \nl at 10 pm. & \checkmark & & The information gets posted on Google Calendar. \\
\hline
Meeting \nl from 10 pm \nl to 12 am. & & \checkmark & The information didn't plot on the Google Calendar even if it was a time interval. It should be corrected. \\
\hline
Project defense \nl at 8 am. & \checkmark & & The information gets posted on Google Calendar. \\
\hline
Date on Friday \nl at 7 pm. & & \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
Watching movies \nl with friends \nl at 10 o'clock \nl in the evening. & & \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}
\label{tab:tab1}
\caption{Google Calendar's responses to different appointment--related informations.}
\end{table}
\lipsum[1-5]
\begin{strip}
\sffamily
\setlength{\tabcolsep}{4pt}
\setlength{\extrarowheight}{2pt}
\noindent
\centering
%\begin{tabularx}{\linewidth}{|X|C{1cm-\tabcolsep}|C{1cm-\tabcolsep}|c|}
\begin{tabularx}{\linewidth}{|C{22mm}|C{1cm-\tabcolsep}|C{1cm-2\tabcolsep}|X|}
\hline
\multirow{6}{=}{\centering Appointment-related information} & \multicolumn{2}{C{2cm}|}{Did the information get posted on the Google Calendar?} & \multirow{6}{*}{\centering Notes}\\
\cline{2-3}
& Yes & No & \\
\hline
I have an appointment\nl at 8. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Meeting at 10. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Family trip \nl on August 5 \nl at 6. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Drink medicine \nl at 8 o'clock. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
Project defense\nl at 8. & & \checkmark & The time is not specified whether it is am or pm, so it does not appear on Google Calendar. \\
\hline
I have an appointment \nl at 10 pm. & \checkmark & & The information gets posted on Google Calendar. \\
\hline
Meeting \nl from 10 pm \nl to 12 am. & & \checkmark & The information didn't plot on the Google Calendar even if it was a time interval. It should be corrected. \\
\hline
Project defense \nl at 8 am. & \checkmark & & The information gets posted on Google Calendar. \\
\hline
Date on Friday \nl at 7 pm. & & \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
Watching movies \nl with friends \nl at 10 o'clock \nl in the evening. & & \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}
\label{tab:tab1}
\captionof{table}{Google Calendar's responses to different appointment--related informations.}
\end{strip}
\lipsum
\end{document}