Re: [docbook-apps] can I move the table of contents?

2012-04-19 Thread Thomas Schraitle
Morning,

  some implementations use completely empty index tags to
   indicate where an automatically generated index should be
   inserted. so [...]

Dominik, if I understood it correctly, Lorenzo talks about the table of
contents, not the index. :)


Back to Lorenzos original question:

 My question: Is there a way I can specify to generate the Table of
 Contents within a specific section instead that at very beginning of
 the document? (For example, some DocBook XSL option...)

I guess you mean to move the TOC to the end of, lets say, a book? Yes,
the DocBook stylesheets has lots of ways how to do this. The easiest
method is to set a parameter, but in this case, I fear, there is none. 

However, if there is no parameter, you have to customize the
respective template(s). First you have to create a customization layer
(see [1] or [2]). Then you have to overwrite the standard
implementation. For example, if you want to move the TOC of a book to
the end, look at html/division.xsl and the book template. Here is the
code:

---[ html/division.xsl ]---
xsl:template match=book
  xsl:call-template name=id.warning/

  div
xsl:apply-templates select=. mode=common.html.attributes/
xsl:if test=$generate.id.attributes != 0
  xsl:attribute name=id
xsl:call-template name=object.id/
  /xsl:attribute
/xsl:if
xsl:call-template name=book.titlepage/

xsl:apply-templates select=dedication 
 mode=dedication/
xsl:apply-templates select=acknowledgements
 mode=acknowledgements/

xsl:variable name=toc.params
  xsl:call-template name=find.path.params
xsl:with-param name=table 
select=normalize-space($generate.toc)/ 
  /xsl:call-template
/xsl:variable

xsl:call-template name=make.lots
  xsl:with-param name=toc.params select=$toc.params/
  xsl:with-param name=toc
xsl:call-template name=division.toc
  xsl:with-param name=toc.title.p
  select=contains($toc.params, 'title')/
/xsl:call-template
  /xsl:with-param
/xsl:call-template

xsl:apply-templates/
  /div
/xsl:template
---

The make.lots is the part that makes the TOC and the
xsl:apply-templates handles the rest of the book. Copy this template
into your customization layer and switch the two. Or in other words:
insert the xsl:apply-templates first and then the make.lots.

I think this should do the trick, but that's just a quick look. Hope
this helps.

Good luck! :)


--- References
[1] http://sagehill.net/docbookxsl/CustomMethods.html#WriteCustomization
[2]
http://doccookbook.sourceforge.net/html/en/DoCookBook.html#dbc.common.dbcustomize

-- 
Gruß/Regards,
Thomas Schraitle

-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org



RE: [docbook-apps] can I move the table of contents?

2012-04-19 Thread Dominik Psenner
Dominik, if I understood it correctly, Lorenzo talks about the table of
contents, not the index. :)

OFFTOPIC

*laughingly*

I never quite got the differences between TOC, indexes and bibliographies.
To me they are all the same thing with different flavours. :-)

/OFFTOPIC


-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org



Re: [docbook-apps] can I move the table of contents?

2012-04-19 Thread Thomas Schraitle
Hi Dominik,

On Thu, 19 Apr 2012 09:23:06 +0200
Dominik Psenner dpsen...@gmail.com wrote:

 Dominik, if I understood it correctly, Lorenzo talks about the table
 of contents, not the index. :)
 
 OFFTOPIC
 
 *laughingly*
 
 I never quite got the differences between TOC, indexes and
 bibliographies. To me they are all the same thing with different
 flavours. :-)

:-)

It's not that difficult:

* The TOC is a consecutive list of all the all titles, mainly of
  chapters, sections, and appendices (sometimes also from figures,
  tables, etc.) The titles appear in their respective order. In a book,
  a TOC is usually printed at the _beginning_.

* The index is an alphabetically sorted list of terms. If you want to
  know where to find something about customization layers, you would
  usually search the index. In a book, the index can be found at the
  _end_.

* A bibliography is a list of books, reports, magazines, Web pages etc.
  for further reading/information. For example, if you write a book
  about DocBook you would certainly refer (or cite) the DocBook
  Definitive Guide from Norman. An item in the bibliography contains
  the author, the ISBN number, edition, publisher, etc. to make it easy
  to find it.
  In a book, a bibliography is usually shown at the end.


Look into a classical book and you will find these parts.

Hope that helps. :)


-- 
Gruß/Regards,
Thomas Schraitle

-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org