有没有办法让 LaTeX 按照文本中引用的顺序放置图形和表格?

发布于 2024-09-27 15:55:02 字数 360 浏览 2 评论 0原文

我认为这个问题很新颖。这是我遇到的问题。我有一段相对较短的文字,与很多数字和一张表格相关联。我希望浮动仅按我指定的顺序出现在页面上。我已将所有表格和图形参数设置为 [hp] 并按照我希望它们在源中出现的顺序放置它们,例如

图 1

图 2

图 3

表 1

图 4

图 5

我遇到的问题是,无论什么 进行文档排版

我按照表 1

图 1

图 2

。我尝试在排版之前删除 Aux 文件。我知道 endfloats 包,但我仍然希望乳胶将浮动放置在文档其他部分的较大文本部分之间。非常感谢任何帮助。

谢谢

I think this question is novel. Here is the problem I have. I have a relatively short piece of text associated with a lot of figures and a table. I want floats to appear on pages just for floats but in the order I specify. I have set all of the table and figure parameters to [hp] and placed them in the order I want them to appear in the source e.g.

Figure 1

Figure 2

Figure 3

Table 1

Figure 4

Figure 5

The problem I have is that no matter what I do the document typesets like this

Table 1

Figure 1

Figure 2

etc....

I have tried trashing the Aux files before typesetting. I am aware of the endfloats package but I still want latex to place the floats in between larger sections of txts in other parts of the document. Any help is greatly appreciated.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一腔孤↑勇 2024-10-04 15:55:02

我将尝试解释为什么 @user476160(放置修饰符 hp 而不仅仅是 p)的修复有效。 figure 是一个float,即不能跨页面分解的元素。 figure 环境接受带有放置提示的参数列表:

\begin{figure}[placement parameters]
% ...
\end{figure}

放置说明符 h 代表此处,并大约放置图形> 与源文本中的同一点。位置说明符 pfigure 放置在仅包含浮点数的特殊页面中:

\begin{figure}[hp]
% ...
\end{figure}

Wikibooks 有一篇关于图形放置的精彩文章,如果您想微调图形和表格的放置。

我还建议在 TeX Stack Exchange 问答 中发布与 LaTeX 相关的问题。

I'll try to explain why the fix by @user476160 (placement modifier hp instead of just p) works. A figure is a float, i.e. an element that cannot be broken across a page. The figure environment accepts a parameter list with placement hints:

\begin{figure}[placement parameters]
% ...
\end{figure}

The placement specifier h stands for here and places the figure approximately at the same point as in the source text. The placement specifier p puts the figure in a special page that contains only floats:

\begin{figure}[hp]
% ...
\end{figure}

Wikibooks has an excellent article on figure placement if you want to fine-tune your figure and table placement.

I also recommend posting LaTeX-related questions in the TeX Stack Exchange Q&A.

肤浅与狂妄 2024-10-04 15:55:02

问题解决了,列表中的第一个数字的参数是 [p] 而不是 [hp]。由于某种原因,这似乎给乳胶带来了很多悲伤。无论如何,问题暂时解决了。数字和文本都按照我指定的顺序出现。

Problem solved, the first figure in my list had the parameter [p] rather [hp]. This seemed to cause latex a lot of grief for some reason. Anyhow problem solved for now. The figures and txt all appear in the order I have specified.

掐死时间 2024-10-04 15:55:02

这很容易。您所要做的就是使用这个包。

\usepackage{float}

并且您必须将图形参数更改为“

\begin{figure}{H}
%..
\end{figure]}

让我知道它是否有效:)”

It is quite easy. All you have to do is use this package.

\usepackage{float}

And you have to change the figure parameters to

\begin{figure}{H}
%..
\end{figure]}

Let me know if it works :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文