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

查看:101
本文介绍了在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指出,可以使用flafter包来确保浮点数永远不会放置在引用之前.要使用此功能,请将以下内容添加到文档的序言中:

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}

请注意,根据此线程flafter的作用是确保浮点数永远不会出现在其在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.

如果您的文档只有几个浮点数,这可能会很好地工作.对于具有大量浮点的文档,放置会变得更加困难,并且您可能会发现所有浮点都一起出现在文档或章节的末尾,或者您可能会收到太多未处理的浮点"错误.建议阅读此页面

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天全站免登陆