Hussein,
Thanks a lot. I did look at section 2.1 in your csssupport document, but
must confess I did not understand the counter issues in example 2.
How should I interprete the counter(n--, upper-roman) part of the CSS
rule "chapter sect1 > title:first-child:before" ?
Regards,
Jens
On Thu, 10 Nov 2005, Hussein Shafie wrote:
> Jens Stavnstrup wrote:
> > How do I modify the CSS stylesheets so that in DocBook book elements all
> > sect1, sect2 element are visually prefixed with the chapter/appendix
> > number.
> >
> > E.g first sect1 element in first Appendix should be displayed as
> >
> > A.1.
> >
> > instead of just
> >
> > 1.
> >
> > which is currently the case
>
> Here it is:
> ---
> @import url(xxe-config:docbook/css/docbook.css);
>
> chapter sect1 > title:first-child:before {
> content: collapser() " " counter(n--, upper-roman) "." counter(n-) " ";
> }
>
> appendix sect1 > title:first-child:before {
> content: collapser() " " counter(n--, upper-alpha) "." counter(n-) " ";
> }
>
> chapter sect2 > title:first-child:before {
> content: collapser() " " counter(n---, upper-roman) "." counter(nn-) " ";
> }
>
> appendix sect2 > title:first-child:before {
> content: collapser() " " counter(n---, upper-alpha) "." counter(nn-) " ";
> }
>
> chapter sect3 > title:first-child:before {
> content: collapser() " " counter(n----, upper-roman) "." counter(nnn-)
> " ";
> }
>
> appendix sect3 > title:first-child:before {
> content: collapser() " " counter(n----, upper-alpha) "." counter(nnn-)
> " ";
> }
>
> chapter sect4 > title:first-child:before {
> content: collapser() " " counter(n-----, upper-roman) "."
> counter(nnnn-) " ";
> }
>
> appendix sect4 > title:first-child:before {
> content: collapser() " " counter(n-----, upper-alpha) "."
> counter(nnnn-) " ";
> }
>
> chapter section > title:first-child:before {
> content: collapser() " " counter(n--, upper-roman) "." counter(n-) " ";
> }
>
> appendix section > title:first-child:before {
> content: collapser() " " counter(n--, upper-alpha) "." counter(n-) " ";
> }
>
> chapter section section > title:first-child:before {
> content: collapser() " " counter(n---, upper-roman) "." counter(nn-) " ";
> }
>
> appendix section section > title:first-child:before {
> content: collapser() " " counter(n---, upper-alpha) "." counter(nn-) " ";
> }
>
> chapter section section section > title:first-child:before {
> content: collapser() " " counter(n----, upper-roman) "." counter(nnn-)
> " ";
> }
>
> appendix section section section > title:first-child:before {
> content: collapser() " " counter(n----, upper-alpha) "." counter(nnn-)
> " ";
> }
>
> chapter section section section section > title:first-child:before {
> content: collapser() " " counter(n-----, upper-roman) "."
> counter(nnnn-) " ";
> }
>
> appendix section section section section > title:first-child:before {
> content: collapser() " " counter(n-----, upper-alpha) "."
> counter(nnnn-) " ";
> }
>
> chapter section section section * section > title:first-child:before,
> appendix section section section * section > title:first-child:before {
> content: "";
> }
> ---
>
> Ready to use configuration files attached to this email. Simply copy
> them to XXE_user_preferences_dir/addon/ and restart XXE.
>