For example, the following listings list line 10 - 15 of this lyx file.
\end_layout
\begin_layout Standard
\begin_inset Include \lstinputlisting{listings.lyx}[firstline=10,lastline=15,language=TeX,breaklines=true,caption={Line 10 - 15 of this listings.lyx file}]
preview false
\end_inset
\end_layout
\begin_layout Section
How to enter listings
\end_layout
\begin_layout Standard
Inline and normal listings are entered through listings inset (introduced
by lyx 1.5.0).
To insert a program listing, choose
\family typewriter
Insert->Program Listing
\family default
.
inline listing is selected by choosing
\family typewriter
inline listing
\family default
in the
\family typewriter
placement
\family default
section.
\end_layout
\begin_layout Standard
File listing is inserted using
\family typewriter
Insert->File->Child Document
\family default
, and choose
\family typewriter
listings
\family default
from the type combo box.
\end_layout
\begin_layout Section
Listings parameters
\end_layout
\begin_layout Standard
The listings package is a very powerful latex packaging, providing more
than 130 parameters that customize the look of your program listings.
Lyx provides direct support for a few most commonly used parameters through
the listings dialog, and an
\family typewriter
advanced
\family default
edit box to enter all other parameters.
\end_layout
\begin_layout Subsection
Global listings options
\end_layout
\begin_layout Standard
It is likely that your document will have several listings of the same type
so it makes sense to customize all of them using global listings options.
To enter these options, choose
\family typewriter
Document -> Settings -> Text Layouts
\family default
and enter listings parameters in the given edit box.
The editbox to the left of the input box can provide valuable information
such as allowed values of a parameter but you may still need to consult
the listings manual for the meanings of the parameters.
\end_layout
\begin_layout Standard
Parameters set via this dialog will output as
\family typewriter
\backslash
lstset
\family default
in latex preamble.
\end_layout
\begin_layout Subsection
Parameters of the listings inset
\end_layout
\begin_layout Standard
If you right-click a listings inset, a listings dialog will be shown that
allows you to customize your listings.
The most commonly used parameters are displayed on the first tab, including
placement, language, numbering and basic style of the code.
More advanced options can be entered at the second
\family typewriter
advanced
\family default
tab.
\end_layout
\begin_layout Subsection
Parameters of listings child document
\end_layout
\begin_layout Standard
The child document dialog provides less support for commonly used listings
parameters so you will have to enter them manually.
\end_layout
\begin_layout Subsection
Caption and label
\end_layout
\begin_layout Standard
Parameters
\family typewriter
caption={blah}
\family default
and
\family typewriter
label={blah}
\family default
are handled separately from other listings parameters.
In the
\family typewriter
Child Document
\family default
dialog, caption ad label should be entered in the given caption and label
edit boxes.
In a listing inset, you can insert caption through