Long code samples in shaded table

Combs, Richard richard.combs at Polycom.com
Wed Dec 2 09:14:19 PST 2009


Steve Rickaby wrote: 
 
> At 11:28 +0100 2/12/09, Klaus Daube wrote:
> 
> >How about this idea:
> >- Convert all lines (paragraphs) of the code example to a table (one
> paragraph becoming one
> >row.
> >- Use a table format with no horizontal ruling between the rows.
> >- The automatic breakting between the rows should be no problem.
> 
> That sounds feasible: I will try it. It might be a little awkward
getting
> the 'line' spacing right, but it's worth a go.

Not awkward -- only simple math. :-) You can do it with either the table
format's Default Cell Margins or the paragraph format's Table Cell
properties. 

In my template, I use a borderless table for code snippets, and its top
and bottom cell margins are 0 pts., so the spacing between rows is
controlled strictly at the pgf level. 

My Code pgf format is 9 pt with 12 pt line spacing, and there's no space
above or below the pgf. 12 - 9 = 3. So Cell Margins Top (on the Table
Cell properties tab) is set to 3.0 pt (and Bottom is 0 pt). Bingo. Code
text in two adjacent rows is spaced exactly the same as in two adjacent
lines, which is exactly the same as two adjacent pgfs. 

No calculator or trial and error was required. :-)


Richard G. Combs
Senior Technical Writer
Polycom, Inc.
richardDOTcombs AT polycomDOTcom
303-223-5111
------
rgcombs AT gmailDOTcom
303-777-0436
------








More information about the framers mailing list