Lyx - Program Listing - default settings cross-reference

2012-04-01 Thread Rainer Koelle
Hello all,

I am struggling with 
1.) default settings of program listings, and 
2.) creating a cross-reference to (a) program listing(s) 
in my document. 
Unfortunately, the documentation did not shed any light on me...

I use the standard book template for my document. 

1.) How to define 'default settings' for program listings?
Upon inserting a program listing, I am able to tweak the listing properties 
through a right-click and adding / ticking the properties I want. It seems that 
I cannot define personalised preferences. 
And editing the properties for every program listing will be cumbersome (a lot 
of work, as I am going to add a lot of program listings).

2.) How to cross reference a program listing
It seems that one cannot add a labe or define a label in the program listing 
settings (adding a label={listing:somefancynameforlabel} ) also failed 
miserably - did not show up in the reference list.

Thanks for any pointer in the right direction.

Servus from Belgium,
Rainer
-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!  

Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a


Re: Lyx - Program Listing - default settings cross-reference

2012-04-01 Thread Paul A . Rubin
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





Lyx - Program Listing - default settings cross-reference

2012-04-01 Thread Rainer Koelle
Hello all,

I am struggling with 
1.) default settings of program listings, and 
2.) creating a cross-reference to (a) program listing(s) 
in my document. 
Unfortunately, the documentation did not shed any light on me...

I use the standard book template for my document. 

1.) How to define 'default settings' for program listings?
Upon inserting a program listing, I am able to tweak the listing properties 
through a right-click and adding / ticking the properties I want. It seems that 
I cannot define personalised preferences. 
And editing the properties for every program listing will be cumbersome (a lot 
of work, as I am going to add a lot of program listings).

2.) How to cross reference a program listing
It seems that one cannot add a labe or define a label in the program listing 
settings (adding a label={listing:somefancynameforlabel} ) also failed 
miserably - did not show up in the reference list.

Thanks for any pointer in the right direction.

Servus from Belgium,
Rainer
-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!  

Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a


Re: Lyx - Program Listing - default settings cross-reference

2012-04-01 Thread Paul A . Rubin
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





Lyx - Program Listing - default settings & cross-reference

2012-04-01 Thread Rainer Koelle
Hello all,

I am struggling with 
1.) default settings of program listings, and 
2.) creating a cross-reference to (a) program listing(s) 
in my document. 
Unfortunately, the documentation did not shed any light on me...

I use the standard book template for my document. 

1.) How to define 'default settings' for program listings?
Upon inserting a program listing, I am able to tweak the listing properties 
through a right-click and adding / ticking the properties I want. It seems that 
I cannot define personalised preferences. 
And editing the properties for every program listing will be cumbersome (a lot 
of work, as I am going to add a lot of program listings).

2.) How to cross reference a program listing
It seems that one cannot add a labe or define a label in the program listing 
settings (adding a label={listing:somefancynameforlabel} ) also failed 
miserably - did not show up in the reference list.

Thanks for any pointer in the right direction.

Servus from Belgium,
Rainer
-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!  

Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a


Re: Lyx - Program Listing - default settings & cross-reference

2012-04-01 Thread Paul A . Rubin
Rainer Koelle  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