Forum How do I...?

cycling thru image set

jbzech
I'm trying to add an image to a margin box on my :right pages. I can do that easily enough.

Is there a way, though, to cycle through a series of images? For example, the first :right page should place image1.svg, and the next :right page should place image2.svg, etc. After image5.svg, the next :right page should have image1.svg again. And so on.

Thanks for any help.
mikeday
The only way to do this would be to use the new :nth() page selector, but this cannot cycle, so it would require writing as many @page rules as there are pages in the document.
jbzech
Thanks for the reply.

Would it be possible to accomplish what I want with Javascript? (I'm still on Prince 7.1, so I believe I would need to upgrade to use that.)
mikeday
You could use JavaScript to generate the multiple @page:nth() rules, but currently there is no smarter way of doing this, sorry.