On Oct 17, 9:14 pm, Guenter Milde <mi...@users.berlios.de> wrote: > Is it a case so often used by the majority of Sphinx users that it > merits special handling?
Having captions on code listings is quite common AFAIK - then you can refer to "Listing 1" in the text, for example. > Using a rubric instead? > [example snipped] Thanks for the suggestion. I tried it, it renders like this (bottom of image): http://imgur.com/h5ZlP.png I got it close to how I wanted it, but here's a problem: the <pre> containing the included content has margins at top and bottom (it seems to be a browser default, as there seems to be no CSS reset). The DOM looks like this: <p class="precaption rubric">My precaption</p> <div class="highlight-python"><pre>This is an example file</pre></div> <p class="postcaption rubric">My postcaption</p> Now, I don't see an easy way of specifying a CSS rule which turns off the top margin for the <pre> when there's a precaption, and the bottom margin when there's a postcaption. Perhaps your CSS-fu is greater than mine, can you suggest a selector for the <pre> based on "grandparent has class precaption" and/or "parent's sibling has class postcaption"? I thought p.precaption > pre should work at least to give a zero top margin for the pre, but that has no effect (at least in Firefox). Also - the paras have the style "rubric" as well as the style applied via :class: if the attributes on the .rubric and .precaption or .postcaption clash, I'm not sure the results will be predictable and consistent across browsers. Further suggestions gratefully received :-) Regards, Vinay Sajip -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-...@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.