I would like to eliminate the Chapter 1 from the chapter title

Having trouble installing Oxygen? Got a bug to report? Post it all here.
BogdanM777
Posts: 68
Joined: Tue Jun 09, 2015 6:26 pm
Location: Canada

I would like to eliminate the Chapter 1 from the chapter title

Post by BogdanM777 »

Hi,

I have the following problem of formatting.
The chapter first page is very nicely formatted with the "Chapter" the number and then underneath is again the number and the title of the chapter.
I find it a little bit redundant to have the numbers twice on the same page, so I was wondering if it would be possible to eliminate the "Chapter" and the number and have the number and the title instead.
E.g:
- right now I have:
Chapter
1
---------
1 chapter title
--------------
Topics:

- I would like to have just:
1 chapter title
-------------
Topics

Thank you
BogdanM777
Posts: 68
Joined: Tue Jun 09, 2015 6:26 pm
Location: Canada

Re: I would like to eliminate the Chapter 1 from the chapter title

Post by BogdanM777 »

I forgot to specify that I would like also the above to be reflected in the TOC:
- right now I have:
Chapter 1: 1 chapter title
- I would like to have:
1 chapter title

Thank you
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: I would like to eliminate the Chapter 1 from the chapter title

Post by Radu »

Hi Bogdan,

In the XSLT stylesheet:

DITA-OT\plugins\org.dita.pdf2\xsl\fo\commons.xsl

there is an XSLT template:

Code: Select all

 <xsl:template name="insertChapterFirstpageStaticContent">
in which you could consider making some changes to change the layout of the chapter in the PDF content.

About the TOC, the XSLT stylesheet:

DITA-OT\plugins\org.dita.pdf2\xsl\fo\toc.xsl

has a template:

Code: Select all

    <xsl:template match="*[contains(@class, ' bookmap/chapter ')] |
*[contains(@class, ' boookmap/bookmap ')]/opentopic:map/*[contains(@class, ' map/topicref ')]" mode="tocPrefix" priority="-1">
which you could also look into.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
BogdanM777
Posts: 68
Joined: Tue Jun 09, 2015 6:26 pm
Location: Canada

Re: I would like to eliminate the Chapter 1 from the chapter title

Post by BogdanM777 »

Thank you so much Radu.
I will give it a shot and let you know how it goes, OK?

Thank you again
BogdanM777
Posts: 68
Joined: Tue Jun 09, 2015 6:26 pm
Location: Canada

Re: I would like to eliminate the Chapter 1 from the chapter title

Post by BogdanM777 »

Hi Radu,

I looked into the templates that you suggested me, however I am afraid that my level of xsl knowledge is, because I do not do DITA documentation day by day, but now and then, at the "noobe" level, and I do not quite understand too much as what it is in this templates.
Therefore I do not know where to do what change in order to get the formatting I was specifying at the beginning.
If you would give me some suggestions as what to insert/comment/change and where, I would greatly appreciate it, otherwise, as I do not have quite the time to go through the "trial and error" type of approach, I think I will let the formatting as it is.

Thank you
Post Reply