表不必要地从乳胶的下一页开始 [英] Table unnecessarily starting from next page in latex

查看:92
本文介绍了表不必要地从乳胶的下一页开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在乳胶中停止我的表以从下一页不必要地开始,从而在上一页中留出很大的空间?我要如何在标题之后立即开始.这是我的代码:

How can I stop my table in latex to start unnecessarily from next page leaving a huge space in previous page? How can I force to start just after the heading. Here is my code:

我正在使用软件包:

\usepackage{tabularx,ragged2e,booktabs,caption},
\usepackage{float}

我表的代码是:

\begin{table}[H]
\begin{tabular}{| l| l }
$.$ & Matches any character.\\ 
$*$ & Matches zero or more instances of the previous pattern item.\\
$+$ & Matches one or more instances of the previous pattern item.\\
$?$ & Matches zero or one instances of the previous pattern item.\\
$( )$ & Groups a subpattern. The repetition and alternation operators apply to the preceding subpattern.\\
$|$ & Alternation.\\
$[ ]$ & Delimit a set of characters. Ranges are specified as [x-y].\\
\textasciicircum & Anchor the pattern to the beginning of the string. Only when first.\\
\$ & Anchor the pattern to the end of the string. Only when last.\\
\end{tabular}
\end{table}

我尝试了[!ht][!htp][htpb]的任何方法,但该表却消失了.

I tried [!ht], [!htp] and [htpb] nothing of that sort works instead the table vanishes.

推荐答案

不仅在您的表太长而无法垂直容纳在页面中的情况下(例如,标题或某些文本段落下方),您还可以从浮动方法:

Not only in the case that your table is too long to vertically fit into the page (e.g. below a header or some text paragraph), you can switch from the float approach to:

%\begin{center}
\begin{longtable}{|l|l}
    %
  \endfirsthead
    %
  \endhead
    %
  \endfoot
    %
  \endlastfoot
    $.$ & Matches any character.\\ 
    $*$ & Matches zero or more instances of the previous pattern item.\\
    $+$ & Matches one or more instances of the previous pattern item.\\
    $?$ & Matches zero or one instances of the previous pattern item.\\
    $( )$ & Groups a subpattern. The repetition and alternation operators apply to the preceding subpattern.\\
    $|$ & Alternation.\\
    $[ ]$ & Delimit a set of characters. Ranges are specified as [x-y].\\
    \textasciicircum & Anchor the pattern to the beginning of the string. Only when first.\\
    \$ & Anchor the pattern to the end of the string. Only when last.\\
\end{longtable}
%\end{center}

编译后,这看起来与您的table完全一样,只要您在其中包含 \usepackage{longtable} 您的序言(longtable不是浮点数,而table是浮点数).

When compiled, this looks exactly like your table, provided you include \usepackage{longtable} in your preamble (and longtables are not floats, while tables are).

这篇关于表不必要地从乳胶的下一页开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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