我正在尝试用LaTeX写一篇短文,需要添加一个有3列的表。
+-------------+-----------------+--------------------------------------+
| AAAAAAAAAA | BBBBBBBBBBBBBBB | Betty Botter Bought a Bit of Butter |
| | | but the Butter's Bitter |
+-------------+-----------------+--------------------------------------+
| CCCCCCCC | DDDD | Betty Botter Thought: |
| | | If I Put This Bitter Butter in My |
| | | Batter it Will Make My Batter Bitter |
+-------------+-----------------+--------------------------------------+
不幸的是,我似乎找不到正确的习惯用法来做这件事。
我试过了:
\begin{tabular}{lll}
AAAAAAAAAA & BBBBBBBBBBBBBBB & Betty Botter Bought a Bit of Butter but
the Butter's Bitter \\
CCCCCCCC & DDDD & Betty Botter Thought: \newline If I Put This Bitter Butter in My Batter it Will Make My Batter Bitter
\end{tabular}
但是LaTeX不会在单元格中做任何换行或格式化操作。我想我需要告诉它这样做..但是怎么做呢?
发布于 2010-05-24 16:53:13
使用p
列描述符:
变化
\begin{tabular}{lll}
至
\begin{tabular}{llp{5cm}}
要明确插入换行符,请执行以下操作:
CCCCCCCC & DDDD & \parbox{5cm}{Betty Botter Thought: \\ If I Put This Bitter Butter in My Batter it Will Make My Batter Bitter}
发布于 2019-02-09 02:18:54
正如@aioobe在他的回答中所写的那样,在这种情况下,可以从左对齐切换
\begin{tabular}{lll}
对于段落对齐方式,至少在必须手动插入自定义换行符的第三列中:
\begin{tabular}{llp{.5\textwidth}}
编辑完成后,可以使用命令\par
(而不是\newline
)在单元格中实现换行。
这段代码:
\documentclass{article}
\begin{document}
\begin{tabular}{llp{.5\textwidth}}
AAAAAAAAAA & BBBBBBBBBBBBBBB & Betty Botter Bought a Bit of Butter \par but the Butter's Bitter\\
CCCCCCCC & DDDD & Betty Botter Thought: \par If I Put This Bitter Butter in My \par Batter it Will Make My Batter Bitter\\
\end{tabular}
\end{document}
生成请求的输出:
发布于 2017-04-15 17:08:25
这是一个没有花哨编码的答案。将行写在单独的行中。除了最后一行(行)之外,全部省略\hline它既快捷又脏,但是,嘿,它确实有效,并且给了我想要的东西,不管怎么说,对于简单的表。我在为汽车挡风玻璃做广告。我在每个单元格中有3个居中的行
iTutor Grahamstown
Mathematics Tutor
0793296211
我想在我的表中重复使用这个。我只是省略了前两行的hline。使用多行和'|‘可以更轻松地剪切打印输出。
\begin{tabular}{||c||c||c||c||}
\hline\hline
iTutor Grahamstown &iTutor Grahamstown&iTutor Grahamstown &iTutor Grahamstown \\ %No \hline
Mathematics Tutor & Mathematics Tutor & Mathematics Tutor&Mathematics Tutor \\ %No \hline
0793296211 & 0793296211 & 0793296211 & 0793296211\\ \hline\hline\hline %\hline now
\end{tabular}
我希望这能有所帮助。
https://stackoverflow.com/questions/2895780
复制相似问题