Daniel Carrera wrote:
Hi Janet,
Rick raised a question that's not answered in the style guide. So we
need an editor to make a decision:
Rick Barnes wrote:
What is the convention we are using for quoting blocks of code? I am
writing the Calc chapter on macros and I want to be able to refer back
to the code with a standard reference like 'figure 1', 'table 1'...etc.
The template howto does say to use the OOoComputerCode style. But the
style guide does not mention captioning rules for computer code. In
all honesty, it simply didn't cross my mind.
Janet, what do you think?
We don't have a convention, so I'll make one up on the spot. I'm cc'ing
Jean in case she has thoughts on this when she gets back.
In order to put a caption on a code block, it needs to be in its own
text frame. Make the text frame span the full width of the text area.
Use OOoComputerCode paragraph style within in the code block. You might
find it useful to define a frame style for code blocks, so you don't
have to format each one. We can incorporate that style the next time we
update the template.
Put the caption "above" the frame (it will appear within the frame but
above the text). Use "Example" for the category name. (Rick, if that
doesn't fit what you're doing let me know, and we can come up with a
better label. I'd prefer to use "Code Example", but the Category field
doesn't seem to allow spaces.) Then you should be able to make
cross-references to it. "Example" will show up under "Type" in the
Fields dialog box.
Cheers,
--
Janet Swisher --- Senior Technical Writer
Enthought, Inc. http://www.enthought.com