
Could someone provide me with an elegant solution to prevent wrapping of a table caption in lyx? It must wrap at the end of the line, not at the end of the table.
%% LyX 1.6.7 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}
\makeatother
\usepackage{babel}
\begin{document}
%
\begin{table}
\caption{Valleys in promoters of genes correlated with overexpression by breast
cancer subtype}
\label{tab:vlyTallyUniqVlyMtchCntrlOvrExp}
\subtable[Number of valleys in the promoter region marking overexpresses
genes in breast cancer by subtype]{
\label{tab:vlyTallyUniqCombinedVlyMtchCntrlOvrExp}
\begin{tabular}{|c|c|c|c|}
\cline{3-4}
\multicolumn{1}{c}{} & & \multicolumn{2}{c|}{Over-expression}\tabularnewline
\cline{3-4}
\multicolumn{1}{c}{} & & Basal & Luminal \tabularnewline
\hline
Marked & Basal & 131 & 116\tabularnewline
\cline{2-4}
Cell line & Luminal & 100 & 104\tabularnewline
\hline
\end{tabular}
}
\end{table}
%
\begin{table}
\subtable[Directly overlapping valleys in promoters of genes correlated
with overexpression by breast cancer subtype]{
\label{tab:vlyTallyUniqOverlappingVlyMtchCntrlOvrExp}
\begin{tabular}{|c|c|c|c|}
\cline{3-4}
\multicolumn{1}{c}{} & & \multicolumn{2}{c|}{Over-expression}\tabularnewline
\cline{3-4}
\multicolumn{1}{c}{} & & Basal & Luminal \tabularnewline
\hline
Marked & Basal & 26 & 18\tabularnewline
\cline{2-4}
Cell line & Luminal & 20 & 10\tabularnewline
\hline
\end{tabular}
}
\end{table}
\end{document}

\subtablecommand. – Willie Wong Jan 19 '11 at 19:23\usepackage{subfigure}, and I am not quite sure why lyx decided that your two subtables ought to belong to two separatetableenvironments. – Willie Wong Jan 19 '11 at 19:30subfigureorsubfigwill do what you want. After all, one of the goals of those packages allow the subfloats to fit on the same line (horizontally) whenever possible. So it doesn't make much sense to have an option to force the caption to be at full width. – Willie Wong Jan 19 '11 at 19:36\usepackage{subfigure}. – denilw Jan 19 '11 at 21:28