Re: Get page-count into the document
Posted by
mojavelinux on
URL: https://discuss.asciidoctor.org/Get-page-count-into-the-document-tp8296p8297.html
And no, you cannot access the page count using an AsciiDoc attribute reference. But I wouldn't recommend what you are trying to do anyway since you are mixing content and presentation. It would be better to use an extension like a tree processor if media=prepress doesn't give you what you need.
Best Regards,
-Dan
On Tue, Oct 27, 2020 at 2:59 AM TonK [via Asciidoctor :: Discussion] <
[hidden email]> wrote:
I'm creating a large document that consists of multiple files (chapters) that are included. This document is a training with text on the left page explaining a picture that is on the right page. When one of the chapters has an odd number of pages the left/right requirements is messed up. So the picture is on the left and explaining text is on the previous pages, that you can't see. So I have to ensure that every chapter has an even number of pages.
I tried:
----
iifeval::[{page-count} / 2 != 0]
<<<
{emty} +
endif::[]
----
But that doesn;t work as the `page-count` is not available in the document.
Is there any way to ensure the number of pages is even?
--