page numbering

Post here questions and problems related to editing and publishing DITA content.
IsleofGough
Posts: 34
Joined: Fri Dec 02, 2016 9:55 pm

page numbering

Post by IsleofGough »

When I generate a ditamap to pdf based on HTML and CSS, the page numbers are all in roman. It does not do this with XSL-FO. How do I change the HTML/CSS conversion to use normal numbers for page numbers? Thanks.
julien_lacour
Posts: 344
Joined: Wed Oct 16, 2019 3:47 pm

Re: page numbering

Post by julien_lacour »

Hello,

By default only pages in the Table of Contents, Front and Back Matter use the lower roman numbering.
You can check the Default Page Definitions topic from our user-guide for more information.

You can find some examples of headers/footers customization in the Page Headers and Footers topic.

Regards,
Julien
IsleofGough
Posts: 34
Joined: Fri Dec 02, 2016 9:55 pm

Re: page numbering

Post by IsleofGough »

It would be nice if only the front and back matter used lower roman numbering, but the entire book uses roman numbering if built with HTML/CSS. Fortunately I don't have any of these issues with docbook files and ePub or PDF targets. I was just hoping that DITA had reasonable conversions. Here is the ditamap that does not generate regular numbering of pages.Image

Maybe the problem is that I used:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bookmap PUBLIC "-//OASIS//DTD DITA BookMap//EN" "bookmap.dtd">
<bookmap>
Attachments
OxygenProblem.jpg
OxygenProblem.jpg (47.48 KiB) Viewed 273 times
Last edited by IsleofGough on Tue Sep 27, 2022 1:36 am, edited 1 time in total.
chrispitude
Posts: 652
Joined: Thu May 02, 2019 2:32 pm

Re: page numbering

Post by chrispitude »

Hi IsleofGough,

I published a simple <bookmap> with DITA Map PDF - based on HTML5 & CSS and I see the page numbering convention that Julien describes.

Here is the testcase, so maybe you can identify what is different between it and your content:

chemistry_page_numbering.zip
(11.46 KiB) Downloaded 11 times
IsleofGough
Posts: 34
Joined: Fri Dec 02, 2016 9:55 pm

Re: page numbering

Post by IsleofGough »

Thank you for the example. Your ditamap does indeed number correctly. I think I had some left over junk code from the docbook version causing problems.
IsleofGough
Posts: 34
Joined: Fri Dec 02, 2016 9:55 pm

Re: page numbering

Post by IsleofGough »

Julien provided me with the solution to the numbering:
The bookmap is valid indeed but there's still a problem: you are using empty chapters element:

Code: Select all

<chapter>
    <topicref href="topics/Overview.dita"/>
</chapter>
This structure is valid but lead to a wrong interpretation in PDF, you should have this instead:

Code: Select all

<chapter href="topics/Overview.dita"/>
Another variant could be to use the @navtitle attribute:

Code: Select all

<chapter navtitle="MyTitle">
    <topicref href="topics/Overview.dita"/>
</chapter>
_______________
The only issue with this is that the normal numbering does not begin at page "1", as is generally done with real books. It acts as if the numbering starts at page one for the front matter but just gets displayed as roman numbers for the front matter and then normal numbers for the chapters (without resetting the numbering to "1")
Last edited by IsleofGough on Wed Sep 28, 2022 9:23 pm, edited 3 times in total.
julien_lacour
Posts: 344
Joined: Wed Oct 16, 2019 3:47 pm

Re: page numbering

Post by julien_lacour »

Hello,

You can reset the numbering at the first chapter by using a custom CSS rule. The full explanation is available in the How to Reset Page Numbering at First Chapter topic from our user-guide.
Make sure to use the adapted rule depending on your numbering scheme (shallow or deep).

Regards,
Julien
IsleofGough
Posts: 34
Joined: Fri Dec 02, 2016 9:55 pm

Re: page numbering

Post by IsleofGough »

That fixed it. Thanks!
Post Reply