Latex使用-控制表格或者图形的显示位置
2012-11-14 00:05
435 查看
It can be frustrating trying to get your figures and tables to appear where you want them in a LaTeX document. Sometimes, they just seem to float off onto another page of their own accord. Here is a collection of tools and ideas that help you get control
of those pesky floats.
Use the placement options: h, t, b and p. For example
causes LaTeX to try to fit the float “here”, or at the “top” of the current page (or the next page), or at the “bottom” of the current page (or the next page). If “p” is specified, it
will allow the float to take a whole page to itself. You can’t specify only “h” as that is too restrictive, and LaTeX will automatically change it to “ht”. The default setting is “tbp”.
One of the reasons that the floats won’t go where you want them is that there are a lot of constraints on where they can go. The main ones are
These can all be changed individually. But it is often easier to add ! before the placement options, thus forcing LaTeX to ignore most of these contraints. For example, I often use
If you want to change the defaults, the following values give reasonable results:
The
a bad page break, so a useful alternative is to use the
which will put all the floats at the end of the current page.
A very useful package is
causes all unprocessed floats to be processed at that point, but does not start a new page unless it is necessary. To keep floats in the sections in which they were included, use
This silently puts a
Another useful package is
placement in the document.
If you really don’t want LaTeX to move your float at all, then use the
the preamble. This allows you to specify
often gives bad page breaks.
点击打开链接
of those pesky floats.
Use the placement options: h, t, b and p. For example
\begin{figure}[htb] |
will allow the float to take a whole page to itself. You can’t specify only “h” as that is too restrictive, and LaTeX will automatically change it to “ht”. The default setting is “tbp”.
One of the reasons that the floats won’t go where you want them is that there are a lot of constraints on where they can go. The main ones are
Counter | Default | |
topnumber | maximum number of floats at top of page | 2 |
bottomnumber | maximum number of floats at bottom of page | 1 |
totalnumber | maximum number of floats on a page | 3 |
Command | ||
\topfraction | maximum fraction of page for floats at top | 0.7 |
\bottomfraction | maximum fraction of page for floats at bottom | 0.3 |
\textfraction | minimum fraction of page for text | 0.2 |
\floatpagefraction | minimum fraction of floatpage that should have floats | 0.5 |
\begin{figure}[!htb] |
\setcounter{topnumber}{2} \setcounter{bottomnumber}{2} \setcounter{totalnumber}{4} \renewcommand{\topfraction}{0.85} \renewcommand{\bottomfraction}{0.85} \renewcommand{\textfraction}{0.15} \renewcommand{\floatpagefraction}{0.7} |
\clearpagecommand starts a new page and inserts all floats that have not yet appeared before continuing. This can leave
a bad page break, so a useful alternative is to use the
afterpagepackage, and then insert
\afterpage{\clearpage} |
A very useful package is
placeins. This provides the command
\FloatBarrierwhich
causes all unprocessed floats to be processed at that point, but does not start a new page unless it is necessary. To keep floats in the sections in which they were included, use
\usepackage[section]{placeins} |
\FloatBarriercommand before each section. There are other options explained in the
placeinsdocumentation.
Another useful package is
flafter. This causes floats to always appear after their
placement in the document.
If you really don’t want LaTeX to move your float at all, then use the
floatpackage with the command
\restylefloat{figure}in
the preamble. This allows you to specify
[H]as the position parameter which means “Here and only Here”. However, this
often gives bad page breaks.
点击打开链接
相关文章推荐
- 创建一个程序读入和显示视频文件,并可以使用滑动条控制视频文件的播放。一个滑动条用来控制视频播放位置,以10为步长跳进。另一个滑动条用来控制停止/播放
- displaytag的使用方法(用于数据表格的显示和功能控制)
- 使用C#模拟键盘输入、鼠标移动和点击、设置光标位置及控制应用程序的显示
- 基于Swift的iOS应用程序开发:使用表格显示并控制数据(四):使用UIRefreshController实现下拉刷新
- 基于Swift的iOS应用程序开发:使用表格显示并控制数据(一):显示数据
- ASP中应用ONMOUSEOVER鼠标点击或者移动到表格格子上时光标位置显示窗体
- 基于Swift的iOS应用程序开发:使用表格显示并控制数据(三):批量处理表格数据
- 弹出层blockui插件主要使用blockUI和unblockUI两个方法来控制弹出层的显示或者隐藏
- 基于Swift的iOS应用程序开发:使用表格显示并控制数据(二):删除表格中的数据
- displaytag的使用方法(用于数据表格的显示和功能控制)Displaytag1.1版本使用方法
- displaytag的使用方法(用于数据表格的显示和功能控制) tabledecorator实现链接按钮
- JS实现控制表格只显示行边框或者只显示列边框的方法
- 美丽的表格样式(使用CSS样式表控制表格样式)
- C#控制定位Word光标移动到任意行或者最后一行,取得光标位置等操作
- 如果使用Ext.form.ComboBox 作为editor,并设置了store,在选择后,在表格单元中显示的是store中的displayfield 而不是valuefield
- 使用DockWindow库 控制窗口的位置
- Latex 表格多行或者多列
- Ubuntu14.04使用VNC无法显示图形界面问题的解决
- iOS 开发 高级:通过AirServer使用AirPlay镜像并实现多屏幕显示控制
- VC6中使用CHtmlView在对话框控制中显示HTML