LaTeX 中的长表

发布于 2024-09-18 05:50:37 字数 539 浏览 2 评论 0原文

我正在将一个表插入到其中已有一些文本的文件中。这是一个部分的结尾,另一个部分的开始之前。

首先,我添加了以下代码(示例,真实的表是一个真正的长表)

\begin{tabular}{|c|c|c|c}
    a&b&c&d\\
    \hline
    c&d&e&f\\
    \hline
\end{tabular}

一切都很好。但我意识到我需要为表格添加标题。所以,然后我将代码更改为:

\begin{table}
    \caption {title}
    \begin{tabular}{|c|c|c|c}
        a&b&c&d\\
        \hline
        c&d&e&f\\
        \hline
    \end{tabular}
\end{table}

现在表格跳到下一部分,并在下一部分之后开始 3-4 行。

我在这里做错了什么?

I am inserting a table in to a file that already has some text in it. This is at the end of a section and right before the beginning of another.

First I added the following code (sample, the real table is a real long one)

\begin{tabular}{|c|c|c|c}
    a&b&c&d\\
    \hline
    c&d&e&f\\
    \hline
\end{tabular}

Everything is fine. However I realise I need a caption to the table. So, then I changed the code to:

\begin{table}
    \caption {title}
    \begin{tabular}{|c|c|c|c}
        a&b&c&d\\
        \hline
        c&d&e&f\\
        \hline
    \end{tabular}
\end{table}

Now the table jumps into the next section and starts 3-4 lines after the next section.

What am I doing wrong here?

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

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

发布评论

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

评论(1

梦幻之岛 2024-09-25 05:50:37

尝试使用longtable包。或者您可以使用 \begin{table}[!h]

try using the longtable package. or you can use \begin{table}[!h]

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