所以我的问题是我该如何正确地呈现下面的电子邮件表格以便它在第一行显示元数据然后在接下来的几行中显示电子邮件的主题。
在粗略的 ASCII 图中,我希望它看起来类似于以下内容
[sender email ] [Recipient email ][Date ]
[TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL ]
下面是需要适配的 LaTeX 代码。
\begin{center}
\begin{tabular}{ | p{3cm} | p{3cm} | p{3cm} | p{3cm} |}
\hline
Sender & Recipient & Date and Time Of Sending\\
\hline
\hline
[email protected] & [email protected] & 6/31/2006 21:00\\
\hline
TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL \\
\hline
\end{tabular}
\end{center}
答案1
我建议您使用tabularx
环境以及multicolumn{3}{...}{...}
电子邮件文本的指令。为了让表格看起来更“开放”,我会省略所有垂直规则,并使用较少但间距适当的水平规则。
\documentclass{article}
\usepackage{tabularx,booktabs,ragged2e}
\usepackage[hyphens,spaces,obeyspaces]{url}
\newcommand\mc[1]{\multicolumn{3}{@{}>{\RaggedRight}p{\textwidth}@{}}{#1}}
\newcolumntype{Y}{>{\RaggedRight\arraybackslash\small}X}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{@{} YYY @{}}
\toprule
Sender & Recipient & Date and Time of Sending\\
\midrule
\url{[email protected]} & \url{[email protected]} & 6/31/2006 21:00\\
\addlinespace
\mc{TEXT OF EMAIL TEXT OF EMAIL TEXT OF EMAIL
TEXT OF EMAIL TEXT OF EMAIL} \\
\bottomrule
\end{tabularx}
\end{document}