Pages: 1
Print
Author Topic: TOPLEAF: Changing the appearance of Part and Chapter headings in PDF  (Read 4515 times)
awdonald
Member

Posts: 8


« on: March 13, 2013, 10:56:25 AM »

I'm fairly new to XMetaL and TopLeaf, so I'm running into a lot of stumbling blocks and having trouble finding the answers in the documentation. I'm using XMetaL Author Enterprise 7.0 and the evaluation version of TopLeaf.

I'd like chapters and parts to use the navtitle value in place of the "Chapter 1" or "Part I" headings displayed when the PDF is generated.

How do I go about doing this?
Logged
gjn2066
Member

Posts: 60


WWW
« Reply #1 on: March 18, 2013, 10:12:28 PM »

I'm assuming you are using the standard DITAmap stylesheet that came with the (TopLeaf) Plugin. This makes several attempts to get the title from various locations, but the number of ways you can specify a title in DITA means that a stylesheet which tried every possibility would be excessively complex.

To try to simplify things a little the stylesheet generates on-the-fly tags (called custom markers). These custom elements actually control the formatting of the titles, so any format changes only have to be made in a single mapping.

What we then need to do is to cause the appropriate elements in the actual document to generate this custom content.

Say you have an element in your DITA map:
   <chapter ... navtitle="My Title">...</chapter>

Then in the chapter mapping, you put the following into the Pre-content box of the Custom tab:
   <Title level="chapter">{@navtitle}</Title>

This causes the text of the navtitle attribute to be rendered as a chapter title.

Let me know if this info was helpful, or send me a more detailed request if it isn't.

Regards,
Geoff
Logged
awdonald
Member

Posts: 8


« Reply #2 on: March 19, 2013, 02:49:39 PM »

Thanks Geoff! Sorry for not clarifying which stylesheet I'm using. I'm using the book stylesheet template that came with the TopLeaf plugin.

In the default book stylesheet no chapter mapping exists. Creating it with the default attributes and populating the Pre-context box of the Custom tab with:
<Title level="chapter">{@navtitle}</Title>

causes the generated PDF to display the error message
#IMPLIED *** level chapter not mapped

for chapter level headings and
Topic Title *** level P2 not mapped for topic level headings.

Should I not create a mapping for chapter? Or are there other steps I've missed here that are causing the title levels to display as "not mapped"?

Additionally, using the XMetaL default bookmap, navtitles for chapters are populated as <chapter><topicmeta><navtitle>Title... rather than as <chapter ... navtitle="Title Name">. Do I need to use one format instead of the other so TopLeaf can correctly read the navtitle information, or is one as good as the other?

Again, thanks for replying. The feedback is much appreciated and I know it's difficult without having the files I'm working with in front of you.
Logged
gjn2066
Member

Posts: 60


WWW
« Reply #3 on: March 19, 2013, 06:03:23 PM »

OK, I know what the problem is. I'll get back to you hopefully within a day.

Geoff
Logged
gjn2066
Member

Posts: 60


WWW
« Reply #4 on: March 21, 2013, 08:54:07 AM »

The problem has been identified and will be addressed in version 8.10 of the Plugin. This should be available for download next week. I'll keep you posted.
Logged
tonys
JustSystems Partner
Member

Posts: 80


« Reply #5 on: April 04, 2013, 09:34:40 PM »

Sorry for the delay getting back to you.

The reason that there is no chapter mapping is that "chapter" inherits from "topicref", so the topicref mapping is the one that is being used. If you look at the custom content for this mapping you'll see that one of the switch items matches if the class contains bookmap/chapter.

You can add your own chapter mapping, but since this will override the topicref mapping it will need to do all of the things that topicref does, such as reading the referenced topic file. It's probably better not to do this unless there's a good reason to do so.

In DITA 1.2 the navtitle attribute is deprecated, so it would be better to use the navtitle element. The topicref mapping sets the "Natvtitle" variable to the element if it exists, or the attribute if not. This should give you the desired result if you emit it as the right place. What I'm not sure about is how this relates to the title of the topic referenced by the chapter - what you need to do depends on whether the navtitle replaces it or adds to it.
Logged
tonys
JustSystems Partner
Member

Posts: 80


« Reply #6 on: April 10, 2013, 03:47:07 PM »

Did you find a solution to this problem?

I wanted to make sure you weren't waiting for a new version of the plugin. We've determined that there wasn't actually a problem, so no new version is planned at this time.

I also wanted to mention that other people have reported problems with using the navtitle attribute, since it isn't always correctly set. DITA convention seems to be that topic titles should always override the navtitle.
Logged
sirajrangwala
Member

Posts: 7


« Reply #7 on: April 16, 2013, 11:38:25 AM »

Hi,

I'm using TopLeaf 7.6.042 licensed and My XMetal Version#: 6.0.2.070. I have attached a screenshot of my current project. As you can see, I have a Header which needs to contain the Topic or Chapter Title (example: Introduction, Summary, Index etc. which is currently showing ESP) because I am not able to get a different title for each chapter/topic. The current head is {DITA-mainbooktitle} and I don't know how to get a different header as per my DITABookmap.

Additionally, if you see the side grey margin also consists a Block which needs to reflect the current page title (which could be different than the main chapter title) but I'm unsuccessful with that too. I have tried a few options but the output gives no text sometimes with or without errors in log file. Let me know if I'm missing on something basic. In the screenshot both show ESP because thats what is successfully generated in the output.

My corresponding xml file consists of the following tags only: topic, title, body, fig, image


I have blurred the text and other details due to proprietary reasons.


* Proj Screenshot.jpg (505.46 KB, 1913x789 - viewed 491 times.)
Logged
tonys
JustSystems Partner
Member

Posts: 80


« Reply #8 on: April 16, 2013, 05:22:22 PM »

I don't think this is related to the original poster's question.

I'm not sure I understand what you are trying to do, but perhaps the solution is to define new variables for the chapter/topic title and the page title. These can be set at the appropriate place - although I don't know what "page title" means in DITA. Put the appropriate variable name in the header/footer mapping.

If you have a licence with maintenance you should contact support@turnkey.com.au for assistance.
Logged
Pages: 1
Print
Jump to:  

email us