Hi, Bernhard.

It sounds like you should be using the formal title numbering behavior
of one of the existing elements like example or figure. I hope I'm not
misunderstanding, is your problem that you are using those elements
already, and you need a custom formal element to hold *only* chemical
structure figures?

I think that if you use the formal <figure> element to hold your
chemical structure SVG diagrams, you should be able to use the default
formal title numbering behavior of <figure> to automatically number
those figures. You can do things like generate a list of figures and
customize the words in the figure numbering (for example, "Chemical
structure #: Steran Backbone").

I'm surprised that the <table> element in your example isn't numbered
in the way you want though.

Here are some pages from Bob Stayton's DocBook XSL guide:

http://www.sagehill.net/docbookxsl/FormalTitles.html#FormalNumbering
http://www.sagehill.net/docbookxsl/TOCcontrol.html#TOCcomponents (if
you wanted a list of figures at the start of a book or chapter)

For example, I use figure elements like the one I pasted below. Good luck!

Peter

<?xml version="1.0" encoding="UTF-8"?>
<topic version="5.1" xmlns="http://docbook.org/ns/docbook";>
  <info>
    <title>Test</title>
  </info>

  <figure>
    <title>Steran Backbone</title>

    <mediaobject>
      <imageobject>
        <imagedata fileref="your-image.png"/>
      </imageobject>

      <caption>
        <para>Steran</para>
      </caption>
    </mediaobject>
  </figure>
</topic>
On Thu, Oct 11, 2018 at 12:46 AM Bernhard Kleine
<[email protected]> wrote:
>
> Hi,
>
> this is for sure not the first instance of numbering chemical structure 
> automatically during docbook transformation for print. But I can not find an 
> example to learn from.
>
> I have the following example (of about 100 structures in my book). I want 
> have these structures numbered with a bold number and automatically. I was 
> told by Thomas Schaitle, this can be done by xsl. In "docbook xsl", I do not 
> find an example. Chemical structures in my book are characterized by 
> property="chemical". What is needed is
>
> make a individual number for each structure
> avoid numbering doubly if a structure is shown again
> generate the xreflabel with this number that the xref references find a 
> target.
>
> BTW, if I generate an xreflabel by hand then these structures are correctly 
> numbered. However, to be able to change the sequential arrangement of 
> structures and still have the structures labeld sequentially, it is desirable 
> to number them automatically. Please give me an example how to proceed. I 
> have attached the svg file with the structure.
>
> Regards
>
> Bernhard
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-model href="http://docbook.org/xml/5.1/rng/docbook.rng"; 
> schematypens="http://relaxng.org/ns/structure/1.0";?>
> <?xml-model href="http://docbook.org/xml/5.1/sch/docbook.sch"; 
> type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron";?>
> <section xmlns="http://docbook.org/ns/docbook";
>     xmlns:xlink="http://www.w3.org/1999/xlink"; version="5.1">
>     <title/>
>     <para>polycyclic steran (<xref linkend="chem.steran" 
> role="chem.ref"/>)</para>
>     <table xml:id="Ch06.F.steran" frame="all" rowsep="0" colsep="0" 
> xreflabel="Kap6.F:Steran">
>         <title>Sterane Backbone</title>
>         <tgroup cols="1" align="center">
>             <colspec colname="c1" colnum="1" colwidth="4cm" align="center"/>
>             <tbody>
>                 <row>
>                     <entry><emphasis role="chemname">Steran</emphasis></entry>
>                 </row>
>                 <row>
>                     <entry><inlinemediaobject property="chemical" 
> xml:id="chem.steran">
>                         <imageobject>
>                             <imagedata fileref="../bkchem/steran.svg" 
> width="3.8cm"/>
>                         </imageobject>
>                     </inlinemediaobject></entry>
>                 </row>
>                 <row>
>                     <entry align="right" valign="top"><xref 
> linkend="chem.steran"/></entry>
>                 </row>
>             </tbody>
>         </tgroup>
>     </table>
>
> </section>
>
>
> --
> spitzhalde9
> D-79853 lenzkirch
> [email protected]
> www.b-kleine.com, www.urseetal.net
> -
> thunderbird mit enigmail
> GPG schlüssel: D5257409
> fingerprint:
> 08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to