我发现我的longtable中的标题需要两行,但它似乎可以放在一行中。见下图: alt text http://i42.tinypic.com/96dqms.jpg
我的代码是:
\begin{longtable}{|c|c|c|c||c|c|c|}
\caption{Testing error for training size 100000 and 8000 random counts}\\
\hline
\multicolumn{2}{|c|}{Concept} & \multicolumn{2}{c||}{Negative Class} & \multicolumn{2}{c|}{Positive Class} & Error rate \\
\hline
...
\end{longtable}
如何使字幕适合单行?
编辑:
谢谢,杰夫。但是我按照你的建议尝试了“\ usepackage {fullpage}”,pdf文件中的所有内容都搞砸了。
正如您所看到的,标题左侧仍有很多空间。如果标题可以向左移动,它将适合单行。
答案 0 :(得分:17)
你可以这样做:
\LTcapwidth=\textwidth
\begin{longtable}
答案 1 :(得分:4)
两个选项:
longtables文档说明你可以设置一个LTcapwidth
变量,默认为4in。试试\setlength{LTcapwidth}{5.2in}
。如果您只想更改一个字幕宽度,我不确定这是如何工作的,所以
您可以在正确尺寸的标题中强制使用hbox:
\caption{\hskip -0.7in \hbox to 5.2in{Testing error for training size 100000 and 8000 random counts}}
答案 2 :(得分:2)
强制写入一行的一种方法是在mbox中包含标题的标题,如
\mbox{This is a very long title}
你可以尝试
\caption{\mbox{This is a very long title}}
或
\mbox{\caption{This is a very long title}}
答案 3 :(得分:1)
我的猜测是你的桌子比页面宽。换句话说,您的标题与边距允许的一样宽,而您的表格太宽了。
尝试将\usepackage{fullpage}
放入序言中。
答案 4 :(得分:0)
只是一个猜测,但尝试:
\usepackage[margin=1cm]{caption}
答案 5 :(得分:0)
这与xl42ii的答案基本相同,但在横向模式下正常工作。使用\linewidth
代替\textwidth
。原因是横向模式会触发\textwidth
和\textheight
的值,而\linewidth
的值保持不变。
所以
\LTcapwidth=\linewidth
\begin{longtable}
会做到这一点。它对我有用。 :)
答案 6 :(得分:0)
只需在设置中添加一个乘数(例如1.2),即可解决您所有的景观问题:
\LTcapwidth=1.2\textwidth
\begin{longtable}