View Single Post
Old 11-09-2019, 01:50 PM   #2
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,807
Karma: 103362673
Join Date: Apr 2011
Device: pb360
How to use asciidoc to get a book with fractional page numbers

I wanted to have an entire book available with fractional page numbering so people could see what reading with fractional page numbers would be like and saw asciidoc as the quickest and easiest way for me to get there. Inserting a page number target (e.g. anchor) is done by placing the characters (without quotes) "[[page_2]]" between the last character of page 1 and the first character of page 2 in the pbook. The exact text of the ID is not critical, it could be "p2", "page-2", whatever. Even the "2" is not essential, but to use anything else seems ill advised.

After that the anchors for fractional pages can be placed between the anchors for integer pages. In my opinion it is not critical for these to be placed mathematically exactly and I did not do so for this example book.

The next step is to convert to EPUB. The python script asciidoc (or the ruby script asciidoctor) generate HTML, but the asciidoc project also provides a2x which can generate PDF or EPUB from the same source file. I used:
Code:
a2x -f epub -a toc Ford_MyLife.adoc
Next a pagelist needs to be added to toc.ncx in the EPUB or a page-map.xml file added to the EPUB and a reference to page-map.xml added to content.opf. A script to generate a pagelist is in my thread on repairing defective apnx files in the kindle formats forum.

If a kindle format is desired, kindlegen can convert the EPUB to a fat mobi and kindleunpack can split that into KF7 and KF8 versions complete with matching apnx files.
Attached Files
File Type: gz Ford_MyLife.adoc.gz (186.3 KB, 333 views)

Last edited by j.p.s; 11-16-2019 at 12:21 PM. Reason: Describe asciidoc production and conversion
j.p.s is offline   Reply With Quote