[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook] incrementing item numbers in docbook
Thanks Bob! I will read this 3 or 4 times and try some things out. It already makes more sense after the second reading! :) I’m a programmer, but new to XSLT and DocBooks. I haven’t fully wrapped my head around the various layers involved. If I can’t figure it out from your notes here I’ll reply back. Thanks again! Paul > On Jan 18, 2018, at 1:38 PM, Bob Stayton <bobs@sagehill.net> wrote: > > Hi Paul, > This will require customization of templates in certain modes. In general, titles are generated using a template in a mode applied to the element like section. That way it can find the title if it is a child of section or a child of info. > > Numbered titles are generated by applying mode="object.title.markup" to the section. This mode engages the gentext files like common/en.xml to look up the appropriate gentext template like > > <l:template name="section" text="%n. %t"/> > > It fills in %n by applying templates in mode="label.markup" and it fills in %t by applying-templates in mode="title.markup". So you could customize the template for section in mode="title.markup" to first generate your lab label for sections that are labs, and then add the title if you want it. > > Autonumbering is done in XSLT using the <xsl:number> instruction, setting appropriate attributes for what to count and when to reset the number sequence. > > Ask if you need more help with the details. > > Bob Stayton > Sagehill Enterprises > bobs@sagehill.net > >> On 1/13/2018 6:17 PM, Paul Faulstich wrote: >> Hi all, >> I am creating a modular document with chapters and sections. Some of the sections are labs. I'm hoping to auto-number the labs, so I end up with something like this: >> Book >> * Chapter 1 >> ** Section 1 >> ** Section 2: Lab 1.1 >> ** Section 3 >> ** Section 4: Lab 1.2 >> ** Section 5: Lab 1.3 >> * Chapter 2 >> ** Section 1 >> ** Section 2: Lab 2.1 >> ** Section 3: Lab 2.2 >> etc. >> How do I autonumber the Lab titles? >> Many thanks! >> Paul > > --------------------------------------------------------------------- > To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: docbook-help@lists.oasis-open.org >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]