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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mydocbook.css
Type: text/css
Size: 2329 bytes
Desc: not available
Url : 
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20051110/c94f26a0/attachment.css
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mydocbook.xxe
Type: text/xml
Size: 332 bytes
Desc: not available
Url : 
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20051110/c94f26a0/attachment.xml
 

Reply via email to