Rainer Koelle <rqkoelle <at> gmx.net> writes:

> 
> 1.) How to define 'default settings' for program listings?

In Document > Settings... > LaTeX Preamble, insert

\lset{key=value, key=value, ...}

For example: \lstset{language=Fortran,numbers=right}.

> 
> 2.) How to cross reference a program listing

Try inserting the following into Document > Settings... > Local Layout:

Float
        Type                  listing
        GuiName               Listing
        Placement             tbp
        Extension             lol
        NumberWithin          none
        Style                 ruled
        ListName              "List of Listings"
        IsPredefined          false
        UsesFloatPkg          true
        RefPrefix             lst
End

You will now be able to create floats of type "Listing" via Insert > Float >
Listing.  Put each program listing in a float of that type.  Place the labels
inside the float captions.  Cross-references should now work, and you can create
a List of Listings.  You are also free to change "Listing" to something else
(such as "Program") throughout the code above.

Paul



Reply via email to