LaTeX 表格定位 [英] LaTeX table positioning

查看:16
本文介绍了LaTeX 表格定位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 LaTeX 文档,其中包含一个段落,后跟 4 个表格,然后是第二个段落.我希望 4 个表格出现在我已经 阅读的两段之间/a> 表示我应该在开始表环境后使用 [h] 选项(例如 egin{table}[h]).

I have a LaTeX document that contains a paragraph followed by 4 tables followed by a second paragraph. I want the 4 tables to appear between the two paragraphs which from what I've read means I should use the [h] option after beginning the table environment (e.g. egin{table}[h]).

使用此方法,前两个表格按预期显示在第 1 段之后,但是随后显示第 2 段,最后两个表格出现在下一页上.如何让表格出现在正确的位置?

Using this the first two tables appear after paragraph 1 as expected, however paragraph 2 is then displayed with the last two tables appearing on the following page. How can I get the tables to appear in the correct location?

我尝试了各种方法来纠正定位,例如使用 [h!] 但这似乎没有任何效果.在表格之后使用 clearpage 确实具有使表格出现在第二段之前的预期效果,但是当我更愿意时,它将最后两个表格留在自己的页面上并带有大量空白让第二段在表格之后立即开始.

I've tried various things to correct the positioning such as using [h!] however this doesn't seem to have any effect. Using clearpage after the tables does have the desired effect of making the tables appear before the second paragraph but it then leaves the last two tables on their own page with loads of white-space, when I would prefer to have the second paragraph begin immediately after the tables.

Paragraph 1...

egin{table}[h]
    table1...
end{table}

egin{table}[h]
   table2...
end{table}[h]
...

Paragraph 2...

推荐答案

在谷歌搜索之后,我发现了 float 包,它可以防止 LaTeX 重新定位表格.

After doing some more googling I came across the float package which lets you prevent LaTeX from repositioning the tables.

在序言中:

usepackage{float}

然后对于每个表,您可以使用 H 放置选项(例如 egin{table}[H])来确保它不会被重新定位.

Then for each table you can use the H placement option (e.g. egin{table}[H]) to make sure it doesn't get repositioned.

这篇关于LaTeX 表格定位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆