Discussion:
Line spacing in listings
Sven Grüner
2009-04-01 22:01:06 UTC
Permalink
Hi,

I'm trying to enbed some code into my document by using the
subdocument,type=listing way.
First I was surprised that the text wasn't automatically set to a
typewriter font. But basicstyle=\ttfamily fixed this though I'm not
totally certain how.

My current problem is how to set the line spacing in the listings to
singlespace which is set to onehalfspace for the whole document.

I wonder if there is a smarter way than placing /singlespace before each
listing?

Thanks for your help.

regards, Sven
Nikos Alexandris
2009-04-01 23:39:27 UTC
Permalink
Post by Sven Grüner
Hi,
I'm trying to enbed some code into my document by using the
subdocument,type=listing way.
First I was surprised that the text wasn't automatically set to a
typewriter font. But basicstyle=\ttfamily fixed this though I'm not
totally certain how.
My current problem is how to set the line spacing in the listings to
singlespace which is set to onehalfspace for the whole document.
I wonder if there is a smarter way than placing /singlespace before each
listing?
Sven, I bet the answer is in the listing package documentation [1].
There numerous parameters with which you can do magic :-)

Cheers, Nikos
Nikos Alexandris
2009-04-01 23:45:26 UTC
Permalink
Post by Nikos Alexandris
Post by Sven Grüner
I wonder if there is a smarter way than placing /singlespace before each
listing?
Sven, I bet the answer is in the listing package documentation [1].
There numerous parameters with which you can do magic :-)
[1] http://www.ctan.org/get/macros/latex/contrib/listings/listings.ins
Sven Grüner
2009-04-02 00:37:54 UTC
Permalink
Post by Nikos Alexandris
Post by Sven Grüner
I wonder if there is a smarter way than placing /singlespace before each
listing?
Sven, I bet the answer is in the listing package documentation [1].
There numerous parameters with which you can do magic :-)
I spent hours with that DOC but was always looking for "spacing". Now I
took another look and within seconds found lineskip.

The magic in this case was: lineskip={-5pt}

Tanks into the Breisgau!

Continue reading on narkive:
Loading...