Geoffrey Lloyd wrote:
According to the Docs captions cannot be used unless in a float. So it looks like you will have to do ALL this by hand in ERT. I am willing to be stood corrected though.

you shpuld make a difference between a floating environment and a
caption. They are independent from each other. In general we often used
a caption for a float, but we do not need a float to have a caption.

There are different possibilities to get a caption whithout
using one of the floating environments. But you need ERT

see example

Herbert
#LyX 1.3 created this file. For more info see http://www.lyx.org/
\lyxformat 221
\textclass article
\begin_preamble
\usepackage{capt-of}
\end_preamble
\language english
\inputencoding auto
\fontscheme default
\graphics default
\paperfontsize default
\spacing single 
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default

\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard
{
\backslash 
centering{}
\end_inset 

A line with a caption
\layout Standard
\added_space_bottom bigskip 

\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
captionof{table}{my nonsense tabular.
\backslash 
label{tab:1}}}
\end_inset 


\layout Standard

As seen in tabular\SpecialChar ~

\begin_inset LatexCommand \ref{tab:1}

\end_inset 

 it works as expected :-) And now the same as a 
\begin_inset Quotes eld
\end_inset 

figure
\begin_inset Quotes erd
\end_inset 

 ...
\layout Standard
\added_space_bottom bigskip 
First some nonsense text and some more nonsense text First some nonsense
 text and some more nonsense text First some nonsense text and some more
 nonsense text First some nonsense text and some more nonsense text First
 some nonsense text and some more nonsense text 
\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard
{
\backslash 
centering{}
\end_inset 

A line with a caption
\layout Standard
\added_space_bottom bigskip 

\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
captionof{figure}{my nonsense tabular.
\backslash 
label{fig:1}}}
\end_inset 


\layout Standard

As seen in figure\SpecialChar ~

\begin_inset LatexCommand \ref{fig:1}

\end_inset 

 it works as expected :-)
\the_end

Reply via email to