在 LaTeX 中,有没有办法在第一次引用它之后自动放置一个浮点数? [英] In LaTeX, is there a way to put a float automatically after where it is first referenced?

查看:13
本文介绍了在 LaTeX 中,有没有办法在第一次引用它之后自动放置一个浮点数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在编写一个长的单列文档,其中包含许多浮点数(图形和表格).我知道在乳胶中放置花车的常用 b/h/p/t 选项.但是,我想知道是否存在可以让我自动执行以下操作的包或宏:在第一次引用后立即自动放置一个浮点数.因此,如果引用出现在页面 x 的顶部,那么浮动很可能出现在页面 x 的底部,或者可能出现在页面 x+1 的(顶部).在任何情况下,它都应该出现在引用之前.

I am currently writing a long one-column document that contains a lot of floats (figures and tables). I know the usual b/h/p/t options for placing floats in latex. However, I was wondering if there exists a package or macro that would let me do the following automatically: place a float automatically right after it was first reference. So if the reference appears on the top of page x, then the float would most likely appear at the bottom of page x, or maybe at (the top of) page x+1. In any case it should not occur before the reference.

我知道这可能很难实现,但我也不是乳胶大师......

I know that this may be hard to achieve but then I am not a latex guru either...

(请注意,此问题与 这个.)

(Note that this question is different from this one.)

推荐答案

LaTeX Companion 说 fflater 包可用于确保浮动永远不会放在引用之前.要使用它,请将以下内容添加到文档的序言中:

The LaTeX Companion says that the flafter package can be used to ensure that floats are never placed before their references. To use this, add the following to your document's preamble:

usepackage{flafter}

请注意,根据这个帖子fflater 所做的是确保浮动永远不会出现在它在 LaTeX 源代码中的位置之前.

Note that, according to this thread, what flafter does is ensure that the float never appears before its position in the LaTeX source code.

如果您的文档只有几个浮点数,这可能会很好.对于有很多浮动的文档,放置变得更加困难,并且您可能会发现所有浮动都一起出现在文档或章节的末尾,或者您可能会收到太多未处理的浮动"错​​误.建议阅读本页 和 此页面在英国 TeX 常见问题解答中获取更多建议.

This may work well if your document only has a few floats. For documents with lots of floats, placement becomes much more difficult, and you may find that all your floats appear together at the end of the document or chapter, or you may receive a "Too many unprocessed floats" error. I suggest reading this page and this page in the UK TeX FAQ for more suggestions.

这篇关于在 LaTeX 中,有没有办法在第一次引用它之后自动放置一个浮点数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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