Page 1 of 1

page numbering

Posted: Sun Sep 25, 2022 7:39 pm
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.

Re: page numbering

Posted: Mon Sep 26, 2022 10:45 am
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

Re: page numbering

Posted: Tue Sep 27, 2022 1:30 am
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>

Re: page numbering

Posted: Tue Sep 27, 2022 2:17 pm
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 192 times

Re: page numbering

Posted: Tue Sep 27, 2022 7:23 pm
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.

Re: page numbering

Posted: Wed Sep 28, 2022 7:37 am
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")

Re: page numbering

Posted: Thu Sep 29, 2022 9:06 am
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

Re: page numbering

Posted: Mon Oct 03, 2022 2:50 am
by IsleofGough
That fixed it. Thanks!